cascade « Association « JPA Q&A





1. cascade on many-to-one association in hibernate    stackoverflow.com

i'm a bit confused about something right now about hibernate property.I have a parent class that doesn't need to browse it's child for now , eg the type of table that ...

2. Grails many-to-many associations and preventing cascade    stackoverflow.com

So, we have a many-to-many relationship between Customer and Role, set up as:

Customer {
  static hasMany = [roles: Role]
}

Role {
  static hasMany = [customer: Customer]
  static belongsTo = ...

3. Evicting eager associations without cascade="evict"    stackoverflow.com

Is there any way to make Hibernate evict both an entity and all of its eager or one-to-one associations without having to evict associations manually one by one? (And without setting ...

4. Does cascade="all-delete-orphan" have any meaning in a Hibernate unidirectional many-to-many association with a join table?    stackoverflow.com

I have two objects which form a parent-child relationship which have a many-to-many relationship. Following the recommendations in the Hibernate reference manual, I have mapped this using a join table:

<class name="Conference" ...

5. delete option of cascade in Hibernate one-to-one association    coderanch.com

I am not able to delete the corresponding one-to-one relation row using delete option of cascade. Here are the code for my class and Mappings. Code For Employee.java Class. public class Employee { private int eno; private String ename; PersonalDetails personalDetails; public int getEno() { return eno; } public void setEno(int eno) { this.eno = eno; } public String getEname() { ...

6. bidirectionnal association, attribut mappedBy and Cascade    forum.hibernate.org

Hi, I work on an application using JPA. All my association are bidirectional. So if I well understood, I use the mappedBy attribut to specify the owner side. My first question is when I make a CRUD action on an entity, and if that entity is the owner of an association, will the action be propagated to the associated entity ? ...

7. Cascade delete: How to delete association but not object?    forum.hibernate.org

I have three tables: MENU, PERMISSION, and MENUPERMISSION. MENU contains menu options for a website, PERMISSION contains permissions users can possess, and MENUPERMISSION simply has columns MENUID and PERMISSIONID to represent the association of a certain permission with a certain menu option. I want to create a many-to-many relationship in the PERMISSION hbm that will cascade delete to MENUPERMISSION but not ...

8. Cascade associations and REST services    forum.hibernate.org

Hi there! I have a question on designing my associations and cascading. We have an entity with some @OnetoMany and @ManytoOne associations. We also support a rest interface for users updating their entities. We ran in an issue with our users. They want to send a fragment of the data and have it update, just an example of the model: Code: ...

9. Ternary associations with cascading delete    forum.hibernate.org

Hello, can you give me a "cookbook recipe" for implementing a ternary association with support for cascading deletion when an object at any of its ends is deleted? Here is what I want to achieve (based on the brief example from the manual): 1. The entities "employer" and "employee" are associated with a "contract", which might include additional attributes. 2. If ...





10. Cascading Save-Update in One to Many association    forum.hibernate.org

In my understanding, In case of a one to many bidirectional association, with inverse set to true and foreign key set to NOT NULL. If saving the parent is to be cascaded to its children then all is needed is setting the parent pointer in child, adding child to parent and then inserting parent. Inserting parent will then be cascaded to ...

11. Cascading delete on association table    forum.hibernate.org

Beginner Joined: Tue Aug 17, 2004 5:06 am Posts: 46 My problem is a rather simple one: I have two classes (A, C) that are linked by an association class B: Code: A <---- B ----> C A 1:n B n:1 C I do: A --- B --- C A --- B and expected that B is deleted as well. I ...

12. on-delete="cascade" with one-to-one association    forum.hibernate.org

14. Cascade save-update not working on many-to-many association    forum.hibernate.org

Newbie Joined: Thu Jul 21, 2005 5:37 am Posts: 9 Location: Paris Hi, I'll try to rephrase my problem because my previous post didn't get answers (see http://forum.hibernate.org/viewtopic.php?p=2263481#2263481). I'm still struggling with a transfer of persistent objects between two databases (two Sessions). I've got one Hibernate Session opened on PostgreSQL (source) and another opened on HSQL Db (target). Both databases share ...

15. Copy entity and associations in Cascade    forum.hibernate.org

Hibernate version: 3.1 Hello, I have an entity called A that maps a set of B entities. The B entity maps a set of C entities. The C entity maps a set of D entity. I would like to make a copy of a A instance in the database. Is there a way to copy automatically all of the subsets in ...

16. Removing association does'nt delete rec. (cascade set.......    forum.hibernate.org

Hibernate 3.0.5: Below is a mapping for an entity Element Usages: ......... . . . . . . ................ . . .. ............ ...





17. Using cascade styles for unidirectional associations?    forum.hibernate.org

Hi I have a question regarding cascading styles when used for unidirectional associations. Say, I have object X and object Y such that X has a one-to-many association with Y, its unidirectional, so Y doesnt have a back reference to X object. That gives me a table for X object and a table for object Y with a column for x_id, ...

18. Cascade delete in association table    forum.hibernate.org

Newbie Joined: Wed Jul 13, 2005 11:00 am Posts: 5 Hibernate version:3.2 Database: Oracle 10gR2 Hi I am facing an issue in cascading delete when I try to delete a parent entity. The mapping files are as given below: Code: ...

19. Cascades around circular associations    forum.hibernate.org

Hi, Is there anyone out there who could help shed some light on a bug/feature that has been troubling me recently. It appears when there are two classes, A and B, which are connected via a bi-directional one-to-many association and a unidirectional many-to-one from A to B, all with cascade on save-update. I have put together a simple test case: Classes: ...

21. Delete associations to parent automatically (cascade)?    forum.hibernate.org

Hi guys! I have this class Tag that has a set of children Tag objects. A tag can be child of more than one tag. So the mapping is: 1. 2. 3. 4. 5. 6. 7. 8. 9.

22. Cascading save not happening to its association.    forum.hibernate.org

I have a bi-directional association between Item class and Bid class. (based upon An Item can contain many Bids) ...

23. Cascading in ternary association    forum.hibernate.org

Hi, I have the following ternary association (fieldValues) in my class: Code: ...