I'm trying to use Spring Roo to generate entities with a @OneToMany
unidirectional relationship. Here's what I've tried:
entity --class ~.family.Child
field string --fieldName name
controller scaffold ~.web.ChildController
entity --class ~.family.Father
field string --fieldName name
field set --fieldName children --element ~.family.Child --cardinality ONE_TO_MANY
controller scaffold ~.web.FatherController
perform package
This produces the expected entities and database tables (including a link table.) The Father
entity is generated with the following annotation, which conforms to the JPA spec:
@OneToMany(cascade = CascadeType.ALL)
private Set<family.Child> message = new java.util.HashSet<family.Child>();
But when I go to the Roo-generated admin page, and click Create Father
, I find the following message:
Create Father
Name: (field to enter name)
Children: This relationship is managed from the Father side.
This looks like a bug in Roo. Has anyone found a work-around? Or do I have an error in here?