About cascade

manual

Detached Entity Objects

Explains detached entity objects and how to work with detached objects in JPA, including merging them into an EntityManager.... DETACH CascadeType.DETACH enum constant Cascade detach operation See JavaDoc Reference Page... (or ... . ALL CascadeType.ALL enum constant Cascade all operations See JavaDoc Reference Page... , which ...

 
manual

Storing JPA Entity Objects

Explains how to use JPA to store (persist) entity objects in the database.... Page... method or implicitly as a result of a cascade operation. This page covers the following topics: ... PERSIST CascadeType.PERSIST enum constant Cascade persist operation See JavaDoc Reference Page... (or ...

 
manual

Deleting JPA Entity Objects

Explains how to use JPA to delete (remove) entity objects from the database.... Page... method or implicitly as a result of a cascade operation. This page covers the following topics: ... REMOVE CascadeType.REMOVE enum constant Cascade remove operation See JavaDoc Reference Page... (or ...

 
manual

Retrieving JPA Entity Objects

Explains how to use JPA to retrieve entity objects from the database.... CascadeType.REFRESH enum constant Cascade refresh operation See JavaDoc Reference Page... (or ... . ALL CascadeType.ALL enum constant Cascade all operations See JavaDoc Reference Page... , which ...

 
manual

Entity Management Settings

Explains settings and performance tuning of JPA entities in ObjectDB, the fast Java object database for JPA/JDO.... serialization = "false" /> <cascade-persist always = "auto" on-persist = "false" on-commit ... The <persist> element The <cascade-persist> element The <dirty-tracking> element ...

 
api-jpa

javax.persistence.CascadeType

Defines the set of cascadable operations that are propagated to the associated entity.(Enum of JPA)

 
api-jpa

OneToOne.cascade

(Optional) The operations that must be cascaded to the target of the association.(Annotation Element of javax.persistence.OneToOne)

 
issue

New entity objects are duplicated on merge cascading

When merge is cascaded to a new entity object that has not been persisted yet - it becomes persisted twice. This was demonstrated by a Java EE application in this forum thread but may be reproduced also in a simple console test case: ... id ;   @ OneToMany ( cascade = CascadeType . ALL , fetch = FetchType . ... ( fetch = FetchType . LAZY , cascade = CascadeType . ALL ) B b ; ...

 
forum_thread

Cascading merge() leading to "Attempt to persist a reference to a non managed instance" error

Dear Support Using Objectdb 2.3.4_02 I ran into an exception while performing some tests with a parent/child relationship and cascading merge() operations. The parent has an application defined id, while the child's id is generated, but I don't know if this is of concern. The following "test case" reproduces the error: ... int id ;   @ ManyToOne ( cascade = CascadeType . ALL ) @ SuppressWarnings ...

 
forum_thread

OneToMany and cascade delete problem

Hi, I don't really know if this is a bug or maybe model that I make is bad. I have a problem with with two different classes with OneToMany relation to one, shared class. For example (first class): @Entity public static class Store { @OneToMany(targetEntity = Offer.class, mappedBy = "store") private List<Offer> offers; } second class: ... "product" , fetch = FetchType . LAZY , cascade = CascadeType . ALL ) private ... removing product, all "connected" offers are also removed (cascade). After that, when I iterate over offers in store, there is null ...