This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 321
/
clinic.roo
139 lines (109 loc) · 6.04 KB
/
clinic.roo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Project setup
/////////////////
// Create the Spring Boot application
project setup --topLevelPackage org.springframework.roo.petclinic
// Setup the data access layer
jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
// The domain model
/// Enumerations
enum type --class ~.domain.reference.PetType
enum constant --name DOG
enum constant --name CAT
enum constant --name BIRD
enum type --class ~.domain.reference.Specialty
enum constant --name CARDIOLOGY
enum constant --name DENTISTRY
enum constant --name NUTRITION
/// The JPA entities
entity jpa --class ~.domain.Pet --sequenceName PET_SEQ --entityFormatExpression "#{name} (#{type})"
entity jpa --class ~.domain.Visit --sequenceName VISIT_SEQ --entityFormatMessage visit_format
entity jpa --class ~.domain.AbstractPerson --abstract
entity jpa --class ~.domain.Vet --extends ~.domain.AbstractPerson --entityFormatExpression "#{lastName} (#{specialty})"
entity jpa --class ~.domain.Owner --extends ~.domain.AbstractPerson --entityFormatExpression "#{lastName} (#{city})"
focus --class ~.domain.AbstractPerson
field string --fieldName firstName --sizeMin 3 --sizeMax 30
field string --fieldName lastName --notNull --sizeMin 3 --sizeMax 30
field string --fieldName address --notNull --sizeMax 50 --sizeMin 1
field string --fieldName city --notNull --sizeMax 30
field string --fieldName telephone --notNull
field string --fieldName homePage --sizeMax 30
field string --fieldName email --sizeMax 30 --sizeMin 6
field date --fieldName birthDay --type java.util.Date --notNull
focus --class ~.domain.Visit
field string --fieldName description --sizeMax 255
field date --fieldName visitDate --type java.util.Date --notNull --past
// This relation are children part, by ROO-3793 will be declared on parent entity
// field reference --fieldName pet --type ~.domain.Pet --notNull
// field reference --fieldName vet --type ~.domain.Vet
focus --class ~.domain.Pet
field boolean --fieldName sendReminders --notNull --primitive
field string --fieldName name --notNull --sizeMin 1
field number --fieldName weight --type java.lang.Float --notNull --min 0
field enum --fieldName type --type ~.domain.reference.PetType --notNull
// This relation is child part, by ROO-3793 will be declared on parent entity
// field reference --fieldName owner --type ~.domain.Owner
field set --fieldName visits --type ~.domain.Visit
focus --class ~.domain.Vet
field date --fieldName employedSince --type java.util.Calendar --notNull --past
field enum --fieldName specialty --type ~.domain.reference.Specialty --notNull false
field set --fieldName visits --type ~.domain.Visit
focus --class ~.domain.Owner
field set --fieldName pets --type ~.domain.Pet --mappedBy owner --notNull false --cardinality ONE_TO_MANY
entity projection --class ~.domain.VetInfo --entity ~.domain.Vet --fields id,firstName,lastName,specialty --entityFormatExpression "#{firstName} #{lastName}"
repository jpa --entity ~.domain.Vet --interface ~.repository.VetRepository --defaultReturnType ~.domain.VetInfo
repository jpa --all --package ~.repository
service --all --apiPackage ~.service.api --implPackage ~.service.impl
dto --class ~.domain.PetNameAndWeightFormBean
field string --fieldName name
field number --fieldName weight --type java.lang.Float
finder add --entity ~.domain.Pet --name findByNameAndWeight --formBean ~.domain.PetNameAndWeightFormBean
dto --class ~.domain.OwnerFirstNameFormBean
field string --fieldName firstName
finder add --entity ~.domain.Owner --name findByFirstNameLike --formBean ~.domain.OwnerFirstNameFormBean
dto --class ~.domain.OwnerCityFormBean
field string --fieldName city
// Using entity projection as return type
entity projection --class ~.domain.OwnerInfo --entity ~.domain.Owner --fields id,firstName,lastName,city
finder add --entity ~.domain.Owner --name findByCityLike --formBean ~.domain.OwnerCityFormBean --returnType ~.domain.OwnerInfo
finder add --entity ~.domain.Pet --name findByOwner
finder add --entity ~.domain.Pet --name findBySendRemindersAndWeightLessThan
finder add --entity ~.domain.Pet --name findByTypeAndNameLike
finder add --entity ~.domain.Visit --name findByDescriptionAndVisitDate
finder add --entity ~.domain.Visit --name findByVisitDateBetween
finder add --entity ~.domain.Visit --name findByDescriptionLike
web mvc setup
web mvc view setup --type THYMELEAF
web mvc controller --all --responseType JSON
web mvc controller --all --responseType THYMELEAF
// Publishing finders
web mvc finder --all --responseType THYMELEAF
// Adding details
web mvc detail --entity ~.domain.Owner --field pets --views list,show,findByCityLike --responseType THYMELEAF
web mvc detail --all --views list,show --responseType THYMELEAF
web mvc language --code es
security setup --provider DEFAULT
security authorize --class ~.service.impl.OwnerServiceImpl --method delete.* --roles ADMIN
// Setup Jpa Audit and include audit in entities
jpa audit setup
jpa audit add --entity ~.domain.Pet
jpa audit add --entity ~.domain.Owner
jpa audit add --entity ~.domain.Visit
jpa audit add --entity ~.domain.Vet
// Generate new SOAP Services that will be available under "/services" URL
ws endpoint --service ~.service.api.OwnerService --sei ~.ws.api.OwnerWebService --class ~.ws.endpoint.OwnerWebServiceEndpoint --config ~.config.WsEndpointsConfiguration
ws endpoint --service ~.service.api.PetService --sei ~.ws.api.PetWebService --class ~.ws.endpoint.PetWebServiceEndpoint --config ~.config.WsEndpointsConfiguration
// Generating unitary tests for all entities
test unit --class ~.domain.Owner
test unit --class ~.domain.Pet
test unit --class ~.domain.Vet
test unit --class ~.domain.Visit
// Repository integration tests
test integration --class ~.repository.VetRepository
test integration --class ~.repository.OwnerRepository
test integration --class ~.repository.VisitRepository
test integration --class ~.repository.PetRepository
// Controller integration tests
test integration --class ~.web.OwnersCollectionJsonController
test integration --class ~.web.PetsItemJsonController
test integration --class ~.web.VetsCollectionThymeleafController
test integration --class ~.web.VisitsItemThymeleafController