Grails Hello World
1. Installation
http://docs.codehaus.org/display/GRAILS/Installation
Note: ant之后生成個(gè)grails-0.1a-alpha-SNAPSHOT.jar, 離1.0太遙遠(yuǎn)了
2. Quick Start
http://docs.codehaus.org/display/GRAILS/Quick+Start
Note: list.jsp使用GvTags
3. User Guide
http://docs.codehaus.org/display/GRAILS/User+guide
GORM: 對(duì)hb3的封裝, 功能簡(jiǎn)單些, Domain Class = pojo + hbm + validation, one-to-one 和 many-to-one不用定義
1
class User
{
2
@Property Long id
3
@Property Long version
4
5
@Property String login
6
@Property String password
7
@Property String email
8
@Property Date age
9
10
@Property constraints =
{
11
login(length:5..15,blank:false,unique:true)
12
password(length:5..15,blank:false)
13
email(email:true,blank:false)
14
age(range:18..65,nullable:false)
15
}
16
}



2

3

4

5

6

7

8

9

10



11

12

13

14

15

16

http://docs.codehaus.org/display/GRAILS/GORM
http://docs.codehaus.org/display/GRAILS/Validation
Builders:
http://docs.codehaus.org/display/GRAILS/Builders
posted on 2005-11-30 16:06 waterye 閱讀(545) 評(píng)論(0) 編輯 收藏 所屬分類: groovy