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

spring roo初体验的更多相关文章

  1. Spring之初体验

                                     Spring之初体验 Spring是一个轻量级的Java Web开发框架,以IoC(Inverse of Control 控制反转)和 ...

  2. spring cloud 初体验

    spring cloud分为注册端.客户端以及消费端 初体验的理解就是: 注册端就是将之前所有的应用在这边进行注册,然后给每个应用都生成自己的标识,这些应用就是来自于客户端,消费端则通过调用注册端(有 ...

  3. Spring(三) Spring IOC 初体验

    Web IOC 容器初体验 我们还是从大家最熟悉的 DispatcherServlet 开始,我们最先想到的还是 DispatcherServlet 的 init() 方法.我们发现在 Dispath ...

  4. 第23章 Spring MVC初体验

    23.1 鸟瞰Spring MVC 粗略的介绍了SpringMVC的主要组成部分,SpringMVC作为一个Web层的框架,最大的作用是把我从繁重的web.xml文件编写中解救出来,再也不要不停的添加 ...

  5. Spring入门初体验

    Spring其实就是一个容器,让我们更方便的拿到想要的对象. 1.编写一个service // userService.java public interface userService { publ ...

  6. spring mvc(2) spring mvc初体验

    前面讲到随着前端技术的发展,web的开发已经实现了前后分离,并且spring mvc经过多个版本的更新,使用上也变得不一样,并且提供了很多便捷的功能.但是为了便于理解,我们使用比较原始的方式搭建spr ...

  7. spring native 初体验实现 小米控制美的空调

    目前关于 spring native 分享的文章还比较少 写这篇文章的主要目前是分享一下自己写的一个 小米控制美的空调 的程序 集成 spring native 过程中碰到的一些问题和解决方法 先放地 ...

  8. 215.Spring Boot+Spring Security:初体验

    [视频&交流平台] SpringBoot视频:http://t.cn/R3QepWG Spring Cloud视频:http://t.cn/R3QeRZc SpringBoot Shiro视频 ...

  9. Spring JDBCTemplate连接SQL Server之初体验

    前言 在没有任何框架的帮助下我们操作数据库都是用jdbc,耗时耗力,那么有了Spring,我们则不用重复造轮子了,先来试试Spring JDBC增删改查,其中关键就是构造JdbcTemplate类. ...

随机推荐

  1. SOAP很2的问题

    小弟说实话不很懂这方面的东西,但上头要求比较一下这两种方式的优劣,欢迎大家赐教啊!“按照一定的网络传输协议,通过符合 FTP/TCP/IP等协议的数据报或者以SOAP的方式传送到接口服务器.”这是出处 ...

  2. Sort Transformed Array -- LeetCode

    Given a sorted array of integers nums and integer values a, b and c. Apply a function of the form f( ...

  3. 本地navicatl连接linux

    首选你Linux服务器上要装配好了MySQL数据库.输入: # mysql -u root -proot mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@ ...

  4. AHOI 2009 中国象棋

    题面 题目描述 这次小可可想解决的难题和中国象棋有关,在一个N行M列的棋盘上,让你放若干个炮(可以是0个),使得没有一个炮可以攻击到另一个炮,请问有多少种放置方法.大家肯定很清楚,在中国象棋中炮的行走 ...

  5. Apache2 httpd.conf 配置详解

    Apache2 httpd.conf 配置详解 <第一部分> 常用配置指令说明 1. ServerRoot:服务器的基础目录,一般来说它将包含conf/和logs/子目录,其它配置文件的相 ...

  6. 为什么Linux的Fdisk分区时First Sector为2048?

    是为EFI启动预留的,而Fdisk也随着这波的兴起而跟着变. 参考: http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/disc-pa ...

  7. SqlServer发布订阅错误收集

    原文:SqlServer发布订阅错误收集 目录 1. SqlServer发布订阅错误收集 1.1. Message:脚本对于表"dbo.table"失败. 1.1.1. 错误消息 ...

  8. checkStyle总结

    参考网站:https://code.google.com/p/testcq/wiki/CheckStyleRules 1.Variable access definition in wrong ord ...

  9. dubbo接口压测工具stresstester使用

    dubbo接口压测工具stresstester使用 https://blog.csdn.net/u013822349/article/details/79412719

  10. NetBean 远程开发的好文1 --> NetBeans的远程Linux C开发实践

    from:  http://blog.csdn.net/jacktan/article/details/9268535 一直以来总觉得NetBeans生活在Eclipse的阴影下,同样做为一款不错的基 ...