zoukankan      html  css  js  c++  java
  • spring roo初体验

    1、下载spring-roo-2.0.0.M1,并执行如下命令,在/usr/local/bin下面建立一个roo的软连接
     
    sudo ln -s /Users/pud/Documents/still/spring/roo/spring-roo-2.0.0.M1/bin/roo.sh /usr/local/bin/roo
     
    2、在sts的dashborad里面安装roo插件,注意sts的版本是3.7.2.RELEASE,之前用的是3.6.3,咋装装不上。
     
    3、在sts中创建一个spring roo工程。
     
    4、创建连接数据库
    persistence setup --provider HIBERNATE --database MYSQL --userName root --password 123456 --databaseName conference
     
    5、创建实体
    entity jpa --class ~.domain.Speaker --testAutomatically
    entity jpa --class ~.domain.Talk --testAutomatically
     
    6、为实体添加字段
    field string --fieldName firstname --class ~.domain.Speaker --notNull
    field string --fieldName lastname --notNull
    field string --fieldName email --unique --notNull
    field string --fieldName organization
    field date --fieldName birthdate --type java.util.Date --past --notNull
    field number --type java.lang.Long --fieldName age --min 25 --max 60
     
    field string --fieldName title --class ~.domain.Talk --notNull
    field string --fieldName description --notNull --sizeMax 4000
     
    7、为实体增加关联关系
    field set --fieldName talks --type com.dw.roo.conference.domain.Talk --class com.dw.roo.conference.domain.Speaker --mappedBy speaker --notNull false --nullRequired false --cardinality ONE_TO_MANY --transient false --permitReservedWords false
     
    field reference --fieldName speaker  --type com.dw.roo.conference.domain.Speaker --class com.dw.roo.conference.domain.Talk --notNull true --nullRequired false --transient false --permitReservedWords false 
     
    8、增加controller
    controller all --package ~.web
     
    9、添加日志
    logging setup --level INFO --package ALL_SPRING
  • 相关阅读:
    ES6 Symbol类型 附带:Proxy和Set
    why updating the Real DOM is slow, what is Virtaul DOM, and how updating Virtual DOM increase the performance?
    React高级指南
    池(Pool)
    计算机网络Intro
    React基础
    CommonJS 与 ES6 的依赖操作方法(require、import)
    webpack初识(biaoyansu)
    关于时间安排贪心算法正确性的证明
    DP总结
  • 原文地址:https://www.cnblogs.com/puroc/p/5035550.html
Copyright © 2011-2022 走看看