relationship « Cascade « JPA Q&A





1. 1:M relationship in Hibernate and cascading operations    stackoverflow.com

Table SUBCOURSE references COURSE COURSE(id, name) SUBCOURSE(id, course_id, name) So, 1:M. Hibernate generates for Course:

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "course", cascade = CascadeType.ALL)
    public Set getSubCourses() {
  ...

2. Hibernate - One to many relationship and orphanRemoval cascade    stackoverflow.com

I have a basic one to many relation parent / child like in the chapter 21 of Hibernate references book.
The cascade is only from child to parent (persist cascade only because ...

3. hibernate 1:M relationships & cascade    coderanch.com

Hi, I've run into a problem with hibernate relationships. It only appears to occur when using a 1-to-many, bi-directional relationship with *cascade*. Tried posting this question to the hibernate forum, but was bitterly disappointed by their attitude (admittedly they have a right to it, as they're not being payed). Would any of you veteran hibernate users happen to find the time ...

4. Can I apply cascade in an @Any relationship?    forum.hibernate.org

public class Customer { private String name; ...other attributes @Any(metaColumn = @Column(name = "type")) @AnyMetaDef(idType = "long", metaType = "string", metaValues = { @MetaValue(value = "Personal", targetEntity ...

5. cascading and many-to-many relationships    forum.hibernate.org

Hi there, this is just a general begginer question. After reading chapter 8 of the hibernate reference about parent-child relationships I learnt about the use of the cascade attribute to automatically persist and link child objects in the database without having to explicity save them seperately from the parent object. (Hopefully i have grasped concept this correctly..) The example in the ...

6. cascading updates with many-to-one relationship    forum.hibernate.org

Hi folks, I am having trouble with cascading updates in a simple many-to-one relationship. I have an class called LanguageAbility with a one-to-many relationship with a class called Language. When I create a new LanguageAbility object, assign it a non-persisted Language object, then persist the LanguageAbility object, I would expect the Language object to be persisted also (with cascade="all"). However, when ...

7. cascading and many-to-many relationships doubt    forum.hibernate.org

I have an Entity A that has a many to many association with Entity B. Something like this: Code: