hello,
how can i specify the CascadeType for my relations?
I’ve found the “ORM Association End Detail” settings and changed to “Cascade with delete orphan”, this should generate the JPA1 cascade=CascadeType.ALL attribute on the one2many and the Hibernate annotation:
@Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
but nothing happend on next java-roundtrip.
Then i’ve tried to change the code after the first java roundtrip from:
@OneToMany
private Collection employments;
to:
@OneToMany(cascade = CascadeType.ALL)
@Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
private Collection employments;
But both (the additional attribute on OneToMany and the @Cascade annotation) are removed after next java-round-trip.
Furthermore I’ve found no way to specify java-annotations on relations (like the java-annotation tab on classes and members).
Another Question:
we are using java-enumeration string in many cases in our ORMs and saving them in database as String (@Enumerated(EnumType.STRING)).
I’ve put the annotation on each enum-attribute of my ORM-Classes after choosing the enum-class as type.
But the generated ERD generates an integer-column for this enum-type. If i change this to a String-column and sync back to class model i lost the enum-type (replaced with string). How can i avoid this?
Is there an overview of all java-annotations which can be generated from java-round-trip and the respective dialog where i can setup this?
Because it looks like the most ORM-specific dialogs are only for the ORM-Code-Generator and not for java-round-trip…