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
  • 相关阅读:
    构建之法阅读笔记
    10个操作数的随机四则运算测试
    poj 1742 Coins (动态规划,背包问题)
    第二周进度报告
    蓝桥杯 2015年省赛最后一题 生命之树(树形dp)
    蓝桥杯 ALGO-108 最大体积 (动态规划)
    蓝桥杯 algo——6 安慰奶牛 (最小生成树)
    蓝桥杯 algo_5 最短路 (bellman,SPFA)
    蓝桥杯 ALGO-4 结点选择 (树形动态规划)
    软件工程——评价搜狗拼音输入法
  • 原文地址:https://www.cnblogs.com/puroc/p/5035550.html
Copyright © 2011-2022 走看看