relationship « Load « JPA Q&A





1. NHibernate one-to-many relationship lazy loading when already loaded    stackoverflow.com

I have a tree where every node is a Resource class:

public abstract class Resource 
{ 
        public virtual Guid Id { get; set; ...

2. Eager/Lazy loaded member always empty with JPA one-to-many relationship    stackoverflow.com

I have two entities, a User and Role with a one-to-many relationship from user to role. Here's what the tables look like:

mysql> select * from User;
+----+-------+----------+
| id | name  ...

3. Making an update in some eager n-to-n relationship appears at both related entities in JPA    stackoverflow.com

What is the best way to change n-to-n relationships between two entities in JPA. Let me explain with an example: suppose I have both an Author and a Book entity, where a ...

4. eager loading and 1-many relationship    forum.hibernate.org

0 down vote favorite I have a 1-many relationship between class A and class B, represented by a foreign key relation between two tables in the database. and I want hibernate to eagerly load the collection of Bs so that it can be traversed outside a session. So I specify lazy="false" on both the one-to-many and many-to-one mapping entry. B.hbm : ...

6. Parent - child relationship, problem with lazy loading    forum.hibernate.org

Hi, I am using Hibernate 2.1 beta 1 with JBoss and I have a problem with lazy loading. I have a class "Task" which can contain another tasks so I've created bidirectional association between task and its children. Here is a part of my mapping file: ...

7. Lazy loading and parent/child relationships    forum.hibernate.org

Author Message densonk Post subject: Lazy loading and parent/child relationships Posted: Wed Feb 11, 2004 10:12 am Newbie Joined: Tue Feb 10, 2004 4:31 pm Posts: 3 I am having a difficult time successfully implementing a parent/child relationship in Hiberbate and I know I am missing something but I need a second pair of eyes. I have read the ...

8. Composite-Id parent-child relationship, child loading error    forum.hibernate.org

Beginner Joined: Tue Feb 17, 2004 11:20 am Posts: 28 I use latest hibernate with oracle I have 2 tables (parent-child) parent table: MITGLIEDSCHAFT_SCHUTZBRIEF it's composite key -> INSTANZ VARCHAR2 17, 17, 0 Not Null false BEGINNDATUM DATE 0 Not Null false many fiels child table: KINDERLEISTUNGSART it's composite key INSTANZ VARCHAR2 17, 17, 0 Not Null false BEGINNDATUM DATE 0 ...

9. Load data from junction-table in a many-to-many relationship    forum.hibernate.org

Hi all, I understand that you can use to map table's column from the join-table to either ends of the many-to-many relationship. But approach will only give either end entity a one-to-many relationship to the components that contains data collected from the join-tables. What I really want is to have properties of one ends of the many-to-many relationship, to be ...





10. loading objects with one-many relationship    forum.hibernate.org

Can someone post very small example on how to load the objects with one-many relationship? Following is what I want to see... I have an object called Person. It has personId(want to set as primary key) and another propery called name. then I have another object called Address...a person can have many Addresses..so one-many relation between person and address... then when ...

11. loading one-to-many relationship using stored procedure    forum.hibernate.org

Gidday, I'm using stored procedures to load data and have been trying to setup a one-to-many relationship between to classes. I have 2 classes that I can individually load successfully via stored procedures but when I try and use the Set element to to define a one-to-many relationship between the resultsets of ClassA and ClassB, I get an exception - invalid ...

12. Fail to load many-to-one relationship objects.    forum.hibernate.org

I'm using Hibernate 3 and Spring Framework for this app. Here is the setup: I have two classes Facility_user and Facility_role. Every instance of Facility_user must have a security role id in Facility_role. facility_user table: emp_nbr varchar2 primary key role_seq number ..... facility_role table role_seq number primary keu access number name varchar2 .... Facility_user class ... public class Facility_user{ private String ...

13. self relationship never loading parent/children    forum.hibernate.org

Hi, I've seen several postings regarding this topic, and tried several different hibernate settings (lazy true/false, outerjoin=true/false, etc etc), but I'm still at loss. I have a class as follows: /** * * @hibernate.class table="category" * lazy="true" */ public class CategoryDTO implements Serializable{ private static final long serialVersionUID = 1L; private Long id; private CategoryDTO parent; private Set children; public CategoryDTO(){} ...

14. [Hibernate 3.1.3]: Not loading many-to-one relationship.    forum.hibernate.org

Regular Joined: Thu Jul 08, 2004 1:21 pm Posts: 68 Location: Recife - Pernambuco - Brazil Hibernate version: 3.1.3 Name and version of the database you are using: Postgres 8.1.1 Hello, I'm having a curious problem while migrating from Hibernate 2.1.8 to 3.1.3. I have follow Migration Guide's instructions and the migration is almost done, except for one single mapping: a ...

15. Problem loading object in a many-to-one relationship    forum.hibernate.org

Hi, I have a problem with my hibernate configuration. I cant get an object using a many-to-one relationship. I have two tables in my DB, with this mappings files: Code:

16. one-to-one self-relationship and lazy loading problem    forum.hibernate.org

I have class Country that has bidirectional one-to-one ("0..1 to 0..1" to be specific) association to itself. One end of the association has name 'nextCountry', another is called 'previousCountry'. To persist the class I use the following mapping:





18. bidirectional relationship and Lazy Load Exception    forum.hibernate.org

Object A @ManyToOne(fetch=FetchType.LAZY, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) @JoinColumn(name="Screen_ID", nullable=false) public Screen getScreen() { return this.screen; } public void setScreen(Screen screen) { ...