parent « POJO « JPA Q&A





1. hibernate-pojo mapping in parent child relationship    stackoverflow.com

I have two child say C1 and C2 referring to 1 parent say P . Now I have a C1 object and want to access filed from C2 so the way ...

2. Parent/child works in POJO-mode, but not in MAP-mode -- bug?    forum.hibernate.org

Here's the SQL plus the stack trace: Code: Hibernate: select parent0_.PARENT_ID as PARENT1_0_ from PARENT parent0_ where parent0_.PARENT_ID=? Hibernate: select children0_.parent_id as parent2_1_, children0_.CHILD_ID as CHILD1_1_, children0_.CHILD_ID as CHILD1_0_, children 0_.parent_id as parent2_1_0_ from CHILD children0_ where children0_.parent_id=? Exception in thread "main" org.hibernate.LazyInitializationException: illegal access to loading collection at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:172) ...

3. Hashcode and Equals on POJO Entities in parent/child setup    forum.hibernate.org

I'm wondering how exactly I should implement equals() and hashcode() on my objects. Currently I am using the commons HashCodeBuilder and EqualsBuilder for every property on my User/EmailAddress objects. This causes exceptions however when the object is being loaded, due to a circular reference. As the EmailAddress objects are being added to the User, it calls hashcode on EmailAddress, which within ...

4. (Beginner): attaching pojo tot persistent parent    forum.hibernate.org

Hi everybody, (I'm very new to hibernate, so pls give me some credit here.) Say I have an object P that has a list of childeren (A,B,C) in my DB. The user clicked on P in the UI and now want to see its children. So I fetch these objects from the database (on the server) and send them to the ...