cascade « Component « JPA Q&A





1. Does cascade="none" work in component?    forum.hibernate.org

...

2. on-delete=cascade in component collection mapping    forum.hibernate.org

I received this error: org.hibernate.MappingException: only inverse one-to-many associations may use on-delete="cascade": src.model.ParteDeItem.materiais I understand that I can't use on-delete="cascade" on non-inverse one-to-many associations. As it is show in my mapping below, I am mapping a collection os component (a collection of value objects). So, this association can't be inverse. How can I indicate that the foreign key of this association ...

3. Embedded/Components not cascading a manyToOne relation    forum.hibernate.org

Hi all, I have a problem of cascading a relation many-to-one in a component. Syntactically, here is my classes: Code: public class Parent { @CollectionOfElements(fetch = FetchType.LAZY) @JoinTable(name = "parent_child")) @IndexColumn(name = "position", base = 0) private List children = new ArrayList(); ...

4. Join Table with Collection of Components Cascade Issue    forum.hibernate.org

The advantage of a collection of components is clearly the implicit lifecycle of the link objects. To create an association between a Category (QPolicy) and an Item (QRule), ad a new CategorizedItem (QPolicyRule) instance to the collection. To break the link, remove the element from the collection. No extra cascading settings are required, and the Java code is simplified.