persist « Cascade « JPA Q&A

1. Cascading persist and existing object

I am working with JPA and I would like to persist an object (Action) composed of an object (Domain). There is the Action class code:

public class Action {


2. JPA Cascade Persist not working

I have two classes : Expenditure and Category. An Expenditure can have multiple Categories. I wish to implement Cascade save of all Categories(children) with Expenditure(parent). But unable to achieve this.On persisting ...

3. JPA cascade persist - many to one

I have a many to one relationship and I am trying to persist a child entity.

public class Office
public int id;
public int grades;
public set<Employee> employees;

public class Employee{
public int empid;
public Office office;
Office Id ...

4. JPA/Hibernate Persist cascades even if it shouldn't

I got these 2 entities:

public class Book {
    private BookPK id;

    private String title;

    @javax.persistence.ManyToOne(fetch = javax.persistence.FetchType.LAZY)

5. Cascade All persisting leads to StackOverflowError

We are using Hibernate 3.2.6. We have a tree of elements that link to each other in a form like this: Tree.hbm.exml ... Element.hbm.xml:

10. Cascade persisting help !!!!

hello !!!! I have 5 entity : Customer, Order, OrderLine, Contact and ReportBinder. After a long conversation for subscritpion, I persist data concerning the customer and with the cascade, the order and the contact are persist. In the Order there is a Cascade concernig the orderline (the same for contact and ReportBinder) but they are not persisit. Why ?

11. Cascading on persist

I think I am misunderstanding a limitation of cascading when persisting an object into the database. Scenario: An Invoice containing many LineItems. From the docs I see: - One to many relationships must have 'inverse' on the many side. Meaning that the Invoice side of the mapping must be set to 'inverse'. - The inverse side is not cascaded when adding ...

12. Cascade persist but then ignore updates?