Permalink
139 lines (109 sloc) 6.04 KB
// 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