orphan « Map « JPA Q&A





1. Hibernate all-delete-orphan on a child class with two parent classes    stackoverflow.com

I'm looking into a problem, where there are two "parent" classes, P and Q that cascade all-delete-orphan to a "child" class, C. My intuition in Hibernate tells this is really a ...

2. Combining delete-orphan with a where condition    stackoverflow.com

Hibernate mapping question where the behavior is ambiguous and/or dangerous. I have a one-to-many relationship that has a cascade-delete-orphan condition AND a where condition to limit the items in the collection. ...

3. remove collection with delete-orphan not work with null assignment? :(    stackoverflow.com

I am having problems removing another entity through cascade delete-orphan. It works when I clear the associated set collection, but not when I make the set collection null. Let me explain in detail. The ...

4. Hibernate - A collection with cascade=â€?all-delete-orphanâ€? was no longer referenced by the owning entity instance    stackoverflow.com

I'm having the following issue when trying to update my entity " A collection with cascade=�all-delete-orphan� was no longer referenced by the owning entity instance". I have a parent entity and it ...

5. How to enforce orphan deletion on a ManyToOne relationship    stackoverflow.com

@ManyToOne(fetch = LAZY)
@JoinColumn(name = COL_GROUP_ID, nullable = false, insertable = false, updatable = false, referencedColumnName = COL_ID)
@OnDelete(action = CASCADE)
@Cascade(value = DELETE_ORPHAN)
private Group group;
How to enforce orphan deletion on a ManyToOne relationship, ...

6. Hibernate "deleted entity passed to persist" issue with Cascade.DELETE_ORPHAN and parent/child relationship    stackoverflow.com

I have the following self-table mapping:

public class Node implements {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

    ...

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDFATHER", referencedColumnName = "ID")
private Node father;

@OneToMany(mappedBy = "father", fetch = ...

7. EJB 3.0 JPA & Hibernate One-to-Many leaves orphan children?    coderanch.com

Good day, I have seen a few postings that touched on this topic but none that addressed this particular issue. I have what I believe to be a very straight-forward parent child relationship. It is not bi-directional. When the child is removed from the collection of the parent object and the parent object is merged the objects look just fine, however ...

8. What's the expected behaviour of delete-orphan on a map-key    forum.hibernate.org

... ... ...

9. all-delete-orphan and moving children between parents    forum.hibernate.org

Hello, I have the following problem. I need to use all-delete-orphan for the collection in the parent class, just like this: Code: ...





11. How to delete orphan children    forum.hibernate.org

I am having the exact same problem you are. Page 133 of Hibernate in Action describes the behavior of all-delete-orphan as what we expect, but it is not working that way. Hibernate tries to update the record and set the foreign key to null, instead of deleteing. I am using 2.1.6. and Oracle 9i.

12. Moving children between parents with all-delete-orphan    forum.hibernate.org

Mapping documents: Code: ... HI LOW PARAMS ...

13. Problem with removing a child with cascade all-delete-orphan    forum.hibernate.org

I'm using Hibernate 2.1.6 with an inverse one-to-many association and a "all-delete-arphan" cascade. I can get() and saveOrUpdate() the object graph from the database correctly, but when I'm trying to delete a child by calling setParent(null) or calling childSet.remove(aChild), Hibernate (in both cases) says don't dereferemce a collection with cascade="all-delete-orphan". So, if I can't dereference, how should I delete an element ...

14. "all-delete-orphan" parent has child and child and    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2.1 My problem is the following: I have a parent who has a child and the child has a bunch of children. The issue is when I delete the parent, I want the child and it's childs' children to be deleted. When I delete the parent, hibernate tries to ...





18. parent-child one-to-many, delete-orphan is this a good impl?    forum.hibernate.org

Our group just started using Hibernate with AndroMDA and Spring. We have several parent to child one-to-many associations in our DB. Our application requires the use of DTOs or VOs. So we have a situation where we have VOs which mimic the associations of our Hibernate entities. So we have a ParentVO containing a collection of ChildVOs. We then need to ...

19. Many-to-many mappings and orphans    forum.hibernate.org

Hi, I've got a question that's a little long-winded to ask, so please bear with me. I was wondering how to manage a many-to-many relationship with a mapping similar to this: ... ... A document can have many subjects, and ...

20. delete-orphan with a map    forum.hibernate.org

I'm have a map from an entity to a set of entities. I'm currently using an implementation where I create an Entity that holds the list, and a Map in the parent object that maps from an object that that container entity. I can add and retrieve objects, but when I remove an object from the list, the container object isn't ...

21. Reparenting child object without cascading delete-orphan    forum.hibernate.org

I have a persistent class that has a tree-like structure, with each instance being parent to several children of the same type. I've used cascase="all,delete-orphan" so that I can control the association from the children collection itself (which is ordered - the whole thing is basically a folder structure) and have the parent property set automatically. However, if I want to ...

22. How to refresh a parent with "delete-orphan" child    forum.hibernate.org

See http://forum.hibernate.org/viewtopic.php?p=2376465 for more details. I have amended the DeleteTest to show my problem: Code: public void testRefreshAfterDeleteInOtherSession() { Session s = openSession(); s.beginTransaction(); Node parent = new Node( "parent" ); ...

23. delete-orphan updates child reference, doesn't delete child    forum.hibernate.org

Hi all, I'm also having the same problem with cascades on merges and deletes with a table having a many to one, one to many relationship. Did any of you happen to figure out why hibernate NULLs out fields on the entity that are marked as "nullable=false"? This problem has been bothering me for quite some time now. Thanks, Wade

24. manytomany delete orphan    forum.hibernate.org

Is there a delete_orphan cascade type option for manytomany? I have a manytomany relationship between two tables with association table. I want to delete a row in a table with everything related in the other table as well as entries in association table.. For instance, we have event table, people table and event-people table.. people can be in different events, and ...

25. Problems with delete-orphan and inheritance    forum.hibernate.org

Hello, I recently came upon several hibernate issues introduced by an inheritance mapping. The situation: * PriceInformation has a ScalePriceList * ScalePriceList has two specializations (QuantityScalePriceList and DiscountGroupScalePriceList) * Each of the specializations contains 0..n QuantityScalePrices or DiscountGroupScalePrices respectively * The latter ScalePrices inherit from a parent class called ScalePrice I use SINGLE_TABLE strategy as inheritance is used mainly because of ...

26. override DELETE_ORPHAN behavior    forum.hibernate.org

Hi, I have a interesting problem with the cascading annotation. I have a class Customer which has a list of invoices. the list of invoices is annotated like this: @ManyToMany(cascade=CascadeType.ALL) @Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN}) public List getInvoices() { return this.invoices; } What I want to do is when I have a customer1 object that has an reference to invoice1 into the invoices list for ...

27. OneToOne Mapping Doesn't Delete Orphans    forum.hibernate.org

Hi. I have a class User which holds another class UserHistory (for additional data) in OneToOne mapping. When I persist User, a new record for UserHistory is automatically created. The problem is that when I set a new instance of UserHistory in User and persist User, the old UserHistory record is not deleted, even though no one points at it anymore. ...