parent 2 « Map « JPA Q&A





1. How to get all the Children of parent Object in Hibernate    forum.hibernate.org

hi all I have a doubt . How can we get all the children from a hibernate object. I want to check any child object is assossiated with the given object If not I want to make some updations on that Object.Is there is any general solution for this thanking you Rajesh

2. Basic Parent/Child Question    forum.hibernate.org

If I have the following code and XML mapping, should I keep the "Parent.setChildren()" method since "inverse=true" for this Parent class? Hibernate will never use this code/side of association, correct? I'm thinking only Child side code will be used to make the association, but want to make sure I can get rid of the Parent side setter for the association since ...

3. Parent Child question    forum.hibernate.org

I have a parent p1 associated with a set of children (c11,c12,c13...). I have another parent p2 associated with another set of children (c21,c22,c23...) All the above are persisted instances. What is the best approach to swap parents? I want to do something like p1 associated to c21,c22,c23 and p2 associated to c11,c12,c13. I have the following Parent/Child class. class Parent ...

4. Does hibernate support one child table - many parent tables    forum.hibernate.org

Hi We have two tables "Company" and "Person" as follows: Company [ CompanyId int PK Name varchar ] Person [ PersonId int PK FirstName varchar LastName varchar Type varchar TypeId int ] If Person.Type ="Company", then the Person details are for the Company whose Id is the value of Person.TypeId This way a child table (Person) can have multiple parents based ...

5. Parent Child Mapping    forum.hibernate.org

6. Parent / Child - Change the parent of a child    forum.hibernate.org

Newbie Joined: Mon Sep 01, 2008 1:41 pm Posts: 1 Hi people, first of all sorry I my doubt has been answered before, I haven't found anything about it. The thing is quite "simple", though, but I am not able to solve it Code: Category oldParent = currentCategory.getParentCategory(); oldParent.removeChildCategory(currentCategory.getName()); manager.update(oldParent); parent.addChildCategory(currentCategory); manager.update(currentCategory); this is producing the following error: javax.faces.FacesException: Error calling ...

7. parent/child one-to-many doubt? please clear.    forum.hibernate.org

Hello Friends, I have got a parent/child one-to-many mapping 'Employee to ServiceEntry'. My domains and mapping files has been listed below. I just want to know whether the adding and deleting part of child given below in ServiceEntryService.java is correct? ServiceEntry.java -------------------- public class ServiceEntry { private Long id; ....... private Employee attendedBy; geters...... seters...... public Employee getAttendedBy() { return attendedBy; ...

8. parent to children,child to child using parent and child?    forum.hibernate.org

>= 3.2.5: Is it possible to make a one to many connection from the parent to these children, and also have the children have a one to one connection ? Or can you make a one to many from the parent to child_one, and a one-to-one to child_two using key from child_one and the parent? Table parent p_col1, composite key part ...

9. simple parent child persistance    forum.hibernate.org

I am using opensessionview I have Items (parent )and bids (child) In my application I first create items and save them . next i create bids add them to the item and save item (because I am using opensessionview no flush is called after adding bids , so when I see the id with the bid it is null ) is ...





10. Do I really need Child and childId present in Parent ?    forum.hibernate.org

Hibernate version:3.3.1 GA Hello, I have an odd theoretical problem. I have this situation: bean Parent and Child. class Parent { Child c; setChild(c) { this.c = c; } Child getChild() { return c; } } My mappings: {....other attributes}

11. Query for parents based on the child condition    forum.hibernate.org

12. Mapping of table with multiple parents?    forum.hibernate.org

Hi! I've got a table "comments" storing user comments about picture stored in another table "pictures". Those tables are in 1:n association. For the future also comments for video clips should be stored. Because the information is the same as for pictures, I want to use the very same table. The only difference is the foreign key (picture id and video ...

13. How can a new child record be added to an existing parent?    forum.hibernate.org

Newbie Joined: Mon Jul 13, 2009 7:47 am Posts: 4 Please no offence if this is a repeat query. How can a new child record be inserted into a child table for which a parent is already existing? (i.e How can I add record no 2 with status of 'Executed' to child table only?) My code below does not add a ...

14. Issue with Parent/Child updation    forum.hibernate.org

Newbie Joined: Thu Aug 06, 2009 5:57 am Posts: 1 I have an issue with parent/child updation. I have a class User, which has an One to Many relation with another Class UserExtrnRel. I opulate values for the child in a set, that time the linking field User_id is not generated. while saving the value user_id is generated and updated in ...