Directional « Association « JPA Q&A





2. Many-to-many bi-directional association question    forum.hibernate.org

Hi all, I'll preface this with the fact that I'm new to Hibernate, but alas, I have been unable to find the answer to solve my problem while searching the docs, forums, and plenty of results returned by Google for the past couple days. Here's the general class structure idea (with the fluff removed): Code: @Entity @Table(name = "composite_item") public class ...

3. ? on bi-directional associations    forum.hibernate.org

hi all, i currently joined an underway project that is employing hibernate for persistence. i read something in the guide that i'm trying to fully understand. it appears that hibernate does not support bi-directional associations in a 1 - m parent and child relationship using and indexed collection type. i'm sure there's a very obvious reason, or i just read this ...

4. bi-directional association    forum.hibernate.org

Beginner Joined: Thu Sep 02, 2004 9:17 am Posts: 21 Hi, I am having problems with a bi-directional association and lazy-loading. I have two objects: AObject and BObject. AObject contains a set of BObjects, and BObject contains a set of AObjects. The web-application I am developing is using Spring, and the problem I am seeing is when I try, for example, ...

5. Efficiency of huge bi-directional one-to-many associations    forum.hibernate.org

I have two classes, a creator class and a "file" class. Every "file" that is created has a creator, so we have a simple one-to-many association. Code: ...

6. One-shot delete on bi-directional one-to-many associations    forum.hibernate.org

Hey there, After reading through the manual, HAI and 12 pages of posts matching my search criteria on the subject, i decided to post. As the subject says, I have a bi-directional parent/child relationship, mapped as inverse=true and cascade="all-delete-orphan" on the parent side. When I delete a parent instance, hibernate correctly deletes all children attached to that instance. However, sql log ...

7. One-shot delete on bi-directional many-to-many associations    forum.hibernate.org

Hi, As the subject says, I have a bi-directional many-to-many family/model relationship, mapped as cascade="all,delete-orphan" on the family side and inverse="true" on the model side. When I delete a family instance, Hibernate deletes all models attached to this family even models which are attached to others families. Let's take an example : family f1 with models m1,m2,m3 attached, family f2 with ...

8. Infinite loop on bi-directional association    forum.hibernate.org

Hi, I am using Hibernate 3 with Spring 1.2. I have a simple one-to-many association. Lazy loading does not work for some reason (I have already asked about this in this forum and nobody seems to have a clue why), so I have set lazy=false on the "one" end of the one-to-many. The result now is that Hibernate gets into an ...

9. Example Uni-Directional Many-to-Many Association???    forum.hibernate.org

I would greatly appreciate it if someone could point me to an example of a uni-directional many-to-many association (uses link table) that is confirmed (read tested) to work with hibernate 3.1. I have been unable to come up with an example where my link table is updated. The two tables I am joining get updated just not the link table. I ...





10. Two bi-directional one-to-one associations to other class    forum.hibernate.org

private Osoba osoba; @OneToOne( mappedBy = "adresa" ) public Osoba getOsoba(){ return this.osoba; } public void setOsoba( Osoba osoba ){ this.osoba = osoba; } @OneToOne( mappedBy = "adresa_prechodna" ) public Osoba getOsobaPrechodna(){ return this.osoba; } public void setOsobaPrechodna( Osoba osoba ){ this.osoba = ...

11. Bi-directional one-to-one association: 2 ends consistency?    forum.hibernate.org

Hello, I would like to better understand the programming semantics of the one-to-one bi-directional association. For example: Then, I have two java classes : Person { Address address; .... } Address { Person person; .... ...

12. Issue with bi-directional one to many using association tabl    forum.hibernate.org

Hi , I have a many to many relation ship between two table say a and b. Many to many relation ship is by an association table say a_b. I am using hibernate annotations(Version 3.2) Please find below the mapping,SQL to create table package com.test; import java.util.Collection; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; ...