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
  • 相关阅读:
    java项目配置域名(tomcat直接配置 or 使用nginx反向代理)
    java爬虫学习
    python爬虫
    log4j的日志级别(ssm中log4j的配置)
    Python中list,tuple,dict,set的区别和用法
    [转]C# Eval在asp.net中的用法及作用
    【转】一个运维经理的运维经验总结
    [转]使用 LVS 实现负载均衡原理及安装配置详解
    [转]33个网站足以使你成为一个天才
    搜狐邮箱想说爱你不容易!
  • 原文地址:https://www.cnblogs.com/puroc/p/5035550.html
Copyright © 2011-2022 走看看