persist « Cascade « JPA Q&A





1. Cascading persist and existing object    stackoverflow.com

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:

@Entity(name="action")
@Table(name="action")
public class Action {

  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
 ...

2. JPA Cascade Persist not working    stackoverflow.com

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    stackoverflow.com

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;
@OneToMany
public set<Employee> employees;
}

public class Employee{
@GeneratedValue(strategy=GeneratedValue.identity)
public int empid;
@ManyToOne(cascade=cascadeType.ALL)
public Office office;
}
Office Id ...

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

I got these 2 entities:

@javax.persistence.Entity
public class Book {
    @javax.persistence.EmbeddedId
    private BookPK id;

    private String title;

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

5. Cascade All persisting leads to StackOverflowError    forum.hibernate.org

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 !!!!    forum.hibernate.org

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    forum.hibernate.org

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?    forum.hibernate.org