relationship 1 « Relationship « JPA Q&A





1. JPA Hibernate One-to-One relationship    stackoverflow.com

I have a one-to-one relationship but hibernatetool complains when generating the schema. Here's an example that shows the problem:

@Entity
public class Person {
    @Id
    public int ...

2. Hibernate Auditable many-to-many relationships    stackoverflow.com

Consider the following hibernate configuration:

<class name="Person">
<id name="id" column="personId">
    <generator class="native"/>
</id>
<set name="addresses" table="PersonAddress">
    <key column="personId"/>
    <many-to-many column="addressId"
       ...

3. working with one-to-many relationship in hibernate    stackoverflow.com

I'm still learning what hibernate can do and this time i'm trying something that seems not to be working. i have 2 tables users and contacts.as you can guess contacts hold the ...

4. Hibernate+JPA One To One relationship    stackoverflow.com

I have a OneToOne relationship like this :-

Person                        ...

5. how can we achieve relationship in hibernate    stackoverflow.com

i have two tables... i want to get data from second table using primary key of first table...that primary key was act as foreign key in second table...how can retrieve from that ...

6. Are many-many relationships to be avoided and if so, what is the alternative?    stackoverflow.com

I was left a comment that many-many associations are to be avoided, but I cannot find the original comment/user who left me this info. So I'm asking the community, are many-many ...

7. Creating a Tree relationship in hibernate    stackoverflow.com

I'm striving to make this simple thing: I want a tree relationship (forget about performance, it is gonna be shallow, no more than 2 -3 levels). I tried this: @Entity @Table(name = "BASE") public ...

8. alternative way for many-to-many relationship in jpa    stackoverflow.com

How to write code with many-to-many relationship without using jpa @manytomany annotation? For example for two classes Software and for Tags. When i delete Tag - it removes all software. I ...

9. one to multiple many relationship    stackoverflow.com

Consider two tables as mentioned below -
Table1 (id_col, name_col)
Table2 (uid_col, code_col_1, code_col_2)

where,
id_col is primary key for Table1
uid_col is primary key for Table2
and, id_col has one to many relationship with both ...





10. Relationship n:3 Hibernate    stackoverflow.com


I was wondering how to model a n:3 relationship on Hibernate. I have seen a lot of examples using annotations @ManyToMany, @OneToMany.. etc, but none of them n:x, x a natural ...

11. Many-to-one relationship in Hibernate    stackoverflow.com

I would like to establish a relationship many-to-one between two fields on database. I am using PostgreSQL database and Hibernate. The tables are ApplicationField and Device. The first one has 2 ...

12. Working with Hibernate relationships    stackoverflow.com

I'm working in Hibernate. I got 3 entities, that's the relationship among them: User 1 -> N Orders 1 -> N Order Details how could I add a row in table "Order details" ...

13. Hibernate one-to-many relationship    stackoverflow.com

While iterating the data from one-to-may relationship in hibernate,the next record is not fetching, instead the first record printing twice if two records present in DB... I just fetching the data from ...

14. relationships in hibernate    stackoverflow.com

when we want to start a project with hibernate and a Database (MySQL or Postgresql for example) in java it's better to perform the relationships between tables in database or in ...

15. Best way to use JPA with relationships    forums.netbeans.org

public class Permessitemporanei implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "ID_permesso") private Integer iDpermesso; @Column(name = "Stato_permesso") ...

16. Taking Hibernate Relationships to a new (lower) level    coderanch.com

We are designing a database with this new-fangled Hibernate tool in mind. The database has a ClientHeader object/table with fields like firstName, lastName, ssn, etc. We also have a ClientDetails object with info like dob, weight, hairColor, etc. Simple so far: The ClientDetails object started off with a few object members (sets) like Adress, Contact Info (to hold multiple addresses, phone ...





17. Hibernate 1-0,1 relationship    coderanch.com

Hi, My team and I have been struggling with situations where a member object of a class might be null. For instance: class A { B b; } Class B might never get populated. Our DB designer says A is the parent of B so B should have a foreign key reference to A. We can't seem to map this using ...

18. Hibernate 3.0 many-to-one relationships    coderanch.com

Hi, I have 2 tables Team and Player, the primary key of Team is teamid that is auto incremented which is the foreign key for the table Player, I used the

19. Circular relationships in Hibernate not working    coderanch.com

Hey everyone, I'm not sure if I have something configured wrong or this is the correct behavior for Hibernate (I doubt it) but here it goes. I have a table of employees. Each employee can be affiliated with another employee through an extra table containing information about how they are related. So I have an Employee mapping with a of ...

20. hibernate-one to one relationship    coderanch.com

21. tutorial for hibernate relationships    coderanch.com

22. One to One and Many Relationships    forum.hibernate.org

Newbie Joined: Wed Feb 17, 2010 12:46 pm Posts: 6 I have some questions on relationship mapping. here is the db config: Code: CREATE TABLE tContactInfoType ( id int(8) auto_increment not null ...

23. Generation yields multiple copies of relationships    forum.hibernate.org

I am new to Hibernate and am trying to port a php application to a Flex/Spring/Blaze/Hibernate/Mysql environment. I'm using SpringSource Tool Suite (Eclipse) IDE with Hibernate tools. An early step is to reverse engineer an existing MySQL 5 INNODB database with Hibernate tools. Scenario: There is a table for a particular genetic line of Zebrafish stock called the "stock" table. There ...

24. Flatten Relationship    forum.hibernate.org

Hi, I have a situation where I have a ManyToMany relationship, so to get rid of this I have created a table between these two (as I do not like seeing many-to-many's), but now I have the situation where from both sides of this relationship, I need to get the list of the destination relationship, i.e. A - B - C ...

25. many to many relationship    forum.hibernate.org

I have 5 table TA1, TA2, TB1, TB2 and TS. Table TA1 having many to many relationship with table TB1 and table TA2 having many to many relationship with table TB2. the 2 many to many relationship between the 4 tables are joined using one common table TS. Schema of the 5 tables are as below: TA1: ta1ID, etc... TA2: ta2ID, ...

26. Help with managing contents of Hibernate Relationship    forum.hibernate.org

... @EmbeddedId @AttributeOverrides( { @AttributeOverride(name = "stockId", column = @Column(name = "stockId", nullable = false)), @AttributeOverride(name = "tankId", column = @Column(name = "tankId", nullable = false)) }) public Mapstock2tanksId getId() { ...

27. many-to-many relationship    forum.hibernate.org

28. newbie: How to define 1 to * relationship with intermediate    forum.hibernate.org

I have three tables Person, Organization and Address. The relationship between Person and Address is 1 to many, as is the relationship between Organization and Address. I have an intermediate Party table with Party ID that manages the relationship Person - PersonID - Name -PartyID (references Party.ID) Organization -OrgID -Name -PartyID (references Party.ID) Address -AddrID -PartyID (references Party.ID) -Street Party. -PartyID ...

30. Many to two relationship?    forum.hibernate.org

I'm sorry for the dumb title, but I'm just starting to tinker with hibernate (loving it btw) and i'm finding that the way I'd normally design my objects presents an issue. to abridge my application: I have an Account class with a set of Transfers Set my Transfer class has two instances of Account Account source; Account destination; I've learned by ...

31. Using Many to One Relationship    forum.hibernate.org

Hi All, I have gone through one sample at http://www.vaannila.com/hibernate/hibernate-example/hibernate-mapping-many-to-one-1.html and tested the code which is working fine. In above code If I want to save a Student Object I will save Address also in database which means that table Student and Address both will be filled with one more row. My Scenario: In my case huge Address table is already ...

32. Provider could not understand the actual relationship!    forum.hibernate.org

Say the PK of table B is a FK, which references the PK of table A. (and assume EntityA and EntityB are mapped to table A and table B respectively) If EntitityA and EntityB are persisted (and PK is generated for EntityA) the provider should pick up the PK from EntityA and use it for EntityB as well. But EclipseLink needs ...

33. one to many relationship with more than one condition    forum.hibernate.org

I have two tables as mentioned below. QUESTION_ID_SEQ ...

34. one to multiple many relationship    forum.hibernate.org

@Entity @Table(name = "Table1") public class T1 { @OneToMany(targetEntity=T2.class, mappedBy="??????", cascade=CascadeType.ALL) private List t2; //???not sure about this } @Entity @Table(name = "Table2") public class T2 { @ManyToOne @JoinColumn(name="code_col_1") private T1 t1; //???not sure what goes here }

35. How to create a relationship n:3    forum.hibernate.org

36. Is this relationship possible in Hibernate?    forum.hibernate.org

All - I want to know If I can have any Parent/Child relationship between the following tables. In table B I have A_ID which is not null and that is the only key to map with Table A. Please note that A_ID is nullable in Table A. This is current tables defined in our application and I am trying to resolve ...

37. Hibernate tool relationship creation!!!HELP    forum.hibernate.org

Hi, i'm creating my db model using hibernate tools in eclipse. My database has two table, without foreign key: Customer -name (key) -age -state Sales -year -customer -value I import my db in eclipse using the hibernate configuration file, and i obtain three java objects: CustomerId Customer Sales I have to define a relationship between these two objects, in order to ...

38. Many to many relationship - Tricky one    forum.hibernate.org

Hi, I created the following table in oracle and mysql - Student(student_id,student_name) with primary_key(student_id) - Course(course_id,course_name) with primary key(course_id) - Student_course(student_id,course_id) with primary_key(student_id,course_id) The following is the hibernate mappings file generated for student in both mysql and oracle (10g),however I just manually added the cascade="all"

39. many-to-many relationship    forum.hibernate.org

Newbie Joined: Wed Oct 08, 2003 11:27 am Posts: 18 I've read other posts related to this subject but it's still not clear to me. I have 3 tables: ARTICLE, PUBLICATION, and a connection table ART_PUB. Here are my mappings: Code: net.sf.hibernate.Validatable ...

40. Urgent ! How to implement such relationship with hibernate    forum.hibernate.org

I have three Types of objects: Test, TestRequirement and Question. One test relates to many testRequirements. One test relates to many questions generated according to testRequirements. One testRequirement relates to many questions. With relational database, I know I can use one table to contain all the relations, such table has the following columns: tid-------------test id qid------------question id trid------------testRequirement id What I ...

41. Many-to-Many relationship sanity check    forum.hibernate.org

42. Two level one-to-many relationship?    forum.hibernate.org

Hi everyone. Cass A has a one-to-many relationship with Class B. Class B also has a one-to-many relationship of Class C. That is, A can have many B while each B can also have many C. I think I did the right things on Mapping. The problem is I don't know how to save them into the database. SessionFactory sf = ...

43. proxying relationships for writes?    forum.hibernate.org

44. many-to-one relationship    forum.hibernate.org

Hello, what is wrong in this mapping with the : ... ...

45. Two one-to-one relationship    forum.hibernate.org

Just the way you wrote your classes, I'd say. I think two one-to-one associations in class1 refering to class2 will force you to use foreign keys (in the database model) which refer to the primary key of the table corresponding to class2. Usually (which means only a single one-to-one association is used) no extra columns are required, while the linked table ...

46. relationship of hibernate to ODMG    forum.hibernate.org

I was leafing through an old ODMG reference and wondered what the relationship is between hibernate and ODMG. +Does the ODMG standard have a following? +Is HQL closely related to OQL? +How does the ODMG interface map onto the hibernate code? +Is ODMG a good standard to follow or will JDO or some other standard dominate? +Or is it better to ...

47. Understanding simple many-to-one relationship    forum.hibernate.org

Hi, I have read the documentation several times but, there is something I still understand about many-to-one relationships and cascade update, save and delete. On a simple example, imagine I have 2 classes: Code: public class City{ Long id; } public class Team{ Long id; City city; } The mapping should be : Code: ...

48. the one-to-many relationship    forum.hibernate.org

I am trying to set up a simple one-to-many relationship with hibernate and it errors out "ERROR impl.DatastoreImpl - Could not configure datastore from input stream" I have narrowed it down to this section of the hbm.xml: This mirrors the examples in the documentation with one key difference, mine doesn't work. Has ...

49. One to One Relationship    forum.hibernate.org

50. StaleObjectStateException and many-to-many relationship    forum.hibernate.org

Hi, I have a class A with a timestamp attribute for versioning. This class also has a Set for a many-to-many relationship to another class B. I create a transient instance of A and associate it with a new set of an existing B. When I call session.saveOrUpdate( ), I receive the StaleObjectStateException, complaining instance A has been updated or deleted ...

51. Using a proxy to manage a relationship?    forum.hibernate.org

Hibernate very nicely handles relationships between objects and does the correct lazy loading against the DB. Is there a place where I can plug into this my own lazy-loading proxy implementation? A class that takes the parameters from the parent record and does something a little different when fetching the child records? I need (ideally) to substitute just a tiny bit ...

52. Help please - One to many Relationship    forum.hibernate.org

Newbie Joined: Tue Feb 17, 2004 5:23 pm Posts: 1 Hi, This is the first time iam working with Hibernate and iam facing some problems. When iam implementing parent-child relationship a row in the parent table gets created but it does not create it in the child table. What happens is that an Hibernate exception is thrown Hibernate Exception SQL update ...

53. One-2-One relationship    forum.hibernate.org

I've got pretty simple mappings of one-2-one relationship generated by XDoclet. I try to persist a parent object, it doesn't throw any exception but it doesn't store any data into DB either. Oracle9.2 Hibernate 2.1 Mapping:

54. many-2-many relationship    forum.hibernate.org

Hello, I want to implement a many-to-many relationship. Like I have a User object and a UserGroup object. Both has many-to -many relation. Now what did I do: Made a java class for User, with a setter for UserGroups as set Made a java class for UserGroup give mapping for UserGroups set in User mapping file like :

55. one-to-many relationship    forum.hibernate.org

Hi, I've tried this for the last couple of days and read loads of posts to that: I want to store countries. Each country can have 1 or more regions attached to it. These are the mappings (generated with XDooclet): Country.hbm.xml [code]

56. [Help] How to deal with this relationship    forum.hibernate.org

The relationship of two classes A and B is like the this: A*-->1B A many to one B. Some A is associated with a B. I can invoke A.getB() to obtain B. When a B is deleted, all A associated with this B should be set null. So null should be return when A.getB() is invoked. But now after A was ...

58. One-to-one relationship    forum.hibernate.org

Hi, I have the following simple situation: Two classes who has a one-to-one relationship. Class Component generates the key for class Currency. When I store an Object of the Component class type, hibernate only stores the component in the component table, but he doesn't store anything in the currency table. Can somebody help me with this? Here's my code: Code: ...

59. many to one relationship    forum.hibernate.org

Let us take the classic Order-Customer relationship. Order always will have a customer. Hence relationship is Many to one from Order to Customer. All is fine . I want to avoid the left outer join and do a simple inner join since the relationship is mandatory. Is there a way to do this? I tried to specify not-null but did not ...

61. best practise for many to many relationships    forum.hibernate.org

The hibernate reference provides you a good way for using component element. You have some kind of methods to modelize them but it depends your databse schema if you have data into relationship table or not. I had the same problem but after a well and long long :) reading of chapter Parent child relationship I understood hibernate mapping concepts. If ...

62. hibernate2 xdoclet and relationships with 'role' in them    forum.hibernate.org

When using xdoclet in hibernate2 it is required to do the following... After running xdoclet. Does this mean that it us not possible to have relationships called role? Or even with the string 'role' in them? I was starting to think I was going a bit mad when my 'roles' relationship was changing to 'names'. ta, Stuart.

63. One to one relationship    forum.hibernate.org

Hi all, I have two tables: MastRec and OutpRec which both extended from class PKMastRec and have one to one relationship with this mapping on OutpRec.hbm.xml: I want the relationship behaves like this: Every creation and modification on table OutpRec will affect table MastRec. I create a test case for record creation on table OutpRec, but ...

64. many-to-many relationship with itself    forum.hibernate.org

OTUSER.ASGARD_ACCOUNT_NUMBER ...

65. Criticle relationship feature missing    forum.hibernate.org

The structure is very straight forward. I have an object called Package that contains a collection of PackageFile objects. Both of those objects have an id (Long) and a guid (String). Those objects map to package and package_file tables. There is an FK in package_file to package on a column named package_guid. I want to have a hibernate mapped collection where ...

66. Odd Many to Many relationship    forum.hibernate.org

Newbie Joined: Thu Jun 24, 2004 12:59 pm Posts: 4 Using v. 2.1.4 Trying to build a map for an odd data model that is out of my control. The scenario is as follows. Child table can be used in multiple Parent tables. Child table has a composite key of two columns. One element of this composite key is referenced in ...

67. Breaking a one-to-one relationship    forum.hibernate.org

Hi, I'm working on a project that uses Hibernate and Spring. I've got a one to one relationship between two objects. I want to remove, or break, the relationship. I've tried this - objectOne.setObjectTwo( null ); update( objectOne ); but the relationship remains.... any suggestions ? I guess its something simple but I can't find any examples / doco to help ...

68. PropertyValueException with one-to-many relationship    forum.hibernate.org

Newbie Joined: Tue Jul 06, 2004 10:57 pm Posts: 4 I am getting the following exception when trying to create a one-to-many Parent/Child relationship based on the Parent/Child example in the Hibernate Reference Manual: Code: net.sf.hibernate.PropertyValueException: not-null property references a null or transient value: mdl.Child.parent I am using XDoclet to create the mapping files (listed below), but they look the same ...

69. one to many relationship    forum.hibernate.org

Hi, I was doing one to many relationship in Hibernate.A 'Person' class has a one to many relationship with 'Identification' class. Person contains (one) 1) Personid -primary key 2) FirstName Identification contains (many) 1) id - primary key 2) personid -foriegn key to Person 3) Username class person contains a list idlist (of type java.util.List) ,each of its location contains an ...

70. Relationships betwen views    forum.hibernate.org

71. "Clearing down" Relationships    forum.hibernate.org

Im wondering how best to implement certain delete operations in my application. Ive got a Topic which has a set of Memberships to it. Each Membership is associated with a Subscriber. To complicate things, a Subscriber has its own association with Membership: It has the concept of a "default" Membership. One of my use cases is to delete a Topic. Im ...

72. "Clearing down" Relationships    forum.hibernate.org

Im wondering how best to implement certain delete operations in my application. Ive got a Topic which has a set of Memberships to it. Each Membership is associated with a Subscriber. To complicate things, a Subscriber has its own association with Membership: It has the concept of a "default" Membership. One of my use cases is to delete a Topic. Im ...

73. Many-to-Many, can both sides manage the relationship?    forum.hibernate.org

Section 6.8 of the user manual states that a bidirectional relationship is maintained by one end of the relationship. I have a situation where I really want both sides to manage the relationship. This has to do with Users and UserGroups: One User can belong to many UserGroups, and a UserGroup can belong to many users. Everything works fine, except when ...

74. Optional Many-to-One Relationships???    forum.hibernate.org

I have a many-to-one relationship and not all of the values in the table are valid. When I retrieve a list of values Hibernate throws an UnresolvableObjectException with a nice message. The problem is that I would like my app to provide the user the ability to fix the data, so I would like to override this behavior and return null ...

75. Implementing loose relationship    forum.hibernate.org

Hibernate version: 2.17 In my database I have 2 tables which, in combination, represents 1 entity. But there is no foreign key relationship between these two tables. My first table 'Frequency' has 2 columns: frequency_id frequency_name My second table 'ObjectDescription' has 3 columns : language_id object_id description So if I have this data in Frequency: frequency_id frequency_name 1 Weekly then in ...

76. Using non-physical relationship    forum.hibernate.org

Hibernate version: 2.17 Hi guys, I have 5 tables 'AREA', 'LOCATION', 'LANGUAGE', 'TABLELIST' and 'TRANSLATION'. The TABLELIST table is used to define tables in the system while the TRANSLATION table is used to store short_description and long_description for Areas (defined in AREA) and Locations (defined in LOCATION) w.r.t. language (defined in LANGUAGE). The structure of AREA is : areaId (java.lang.Integer) [Primary ...

78. help. a *not* typical many-to-many relationship.    forum.hibernate.org

yes, i guess i did solve this one. but i don't know i solve in a good way or not. __ __ this is the hashcode func in the subscription class __ public int hashCode() { int result; result = Integer.parseInt(user.getUserId()); result ...

79. One to many relationship    forum.hibernate.org

Hi all, I have a problem regarding the mapping of 2 classes in a one to many relation. I have 2 classes namely Reiser.java and Station.java. Reiser.java contains the list of Station. and the association is unidirectional and Station.java does not contain an object of type Reiser. some code in Reise.java// /** * List: Station */ private List station; This is ...

80. Small doubt on a one-to-one relationship    forum.hibernate.org

81. one-to-one Relationship    forum.hibernate.org

Hibernate version: 2.1 Name and version of the database you are using: Oracle 9i I am new to Hibernate. Trying to experiment with it to see if it will save us development/maintenance time accessing our Oracle databases. Started with simple test structure of one table. Persistence went well. However, started experiencing difficulty with persisting data into a related table. In the ...

82. Help with many-many relationship    forum.hibernate.org

83. Need help with networked relationship    forum.hibernate.org

I'm new to Hibernate but I have read two books on the subject. Book learned doesn't mean success so I'm trying to demonstrate hibernate with a real world example. I'm using Hibernate version:2.1 and I'm trying to understand how to define a networked relationship. For example: --------------------- | PART | | PK PART_ID | | S PART_NAME | --------------------- | | ...

84. AssertionFailure working with many-to-many relationship    forum.hibernate.org

Hi all. Im using Hibernate3 and Im trying to play with three objects like this: class A ==> simple primary key (String) class B ==> composite primary key (String, Integer) Class C ==> composite primary key (String, B) Class C has one List of objects type A inside. These are my mappings (in short form):

85. One to Many relationship    forum.hibernate.org

Hi Guys, I have a question regarding one to many relationship. I have the following two tables 1) Table A program_id 2)Table B raceId race_number program_id I have defined a one to many relationship between table A to Table B using key program_id. My question is, I would like to specify a query to retrieve one to many relationship, caz for ...

86. Many-to-many relationships    forum.hibernate.org

Hello, I am trying to write a test class that will insert data in the database. I am using mysql and xdoclet to generate the hibernate mapping. My test class is supposed to insert data in 2 tables: prescription and medicine. These two tables have a many-to-many relationship between them. The code for my test class is as follows: public class ...

87. Non-Identifying Fully Optional Relationships    forum.hibernate.org

88. Advise with 4 elements relationship - Newbie    forum.hibernate.org

Hello to all here I am quite a newbie, and need to face in my first Hibernate task, with a complicated mapping, which I cannot seem to decided how to implement. If you could help me out of your experience, I would be very thankful. I have 4 main entities : Person, Event, Image and Geo-Object. Now - they are all ...

89. Using many-to-one and unique for one to one relationships    forum.hibernate.org

I'm having an issue I cannot seem to find a solution for. I am hoping someone here can help. I put together a very simple application to reproduce the issue outside of my real project. . I am using Hibernate 2.1.8. I have a LeftHand class, and a RightHand class. Each class has a property for the other class. For example... ...

90. One-to-One Relationship    forum.hibernate.org

91. Constrained one-to-many relationship    forum.hibernate.org

Im just learning Hibernate so this should be a good opportunity to earn some credits :) My problem is as follows. I am trying to create mapping files for a hierarchical relationship. The basic idea is this. I have (0-N) accounts. Each account has (0-N) computers. Each computer has (0-N) connections. Pretty simple huh? Here's the catch. I want the accounts ...

92. LazyInitializationException with no relationship    forum.hibernate.org

I am generating LazyInitializationException when viewing data loaded on a hibernate loaded domain object that has no relationships at all. I am using hibernate 3 with spring. When I insert the explicit lazy="false" as an attribute to the class this goes away, but I don't understand why I am getting it in the first place. It must be something dumb but ...

93. one-to-one relationship    forum.hibernate.org

I spent sometime looking at the documentation looking for how to do one-to-one mapping and get the feeling that for unidirectional one to one relationships say between table A & table B, the table which has the foreign key ( let us say if B has a1 column where a1 is the primary key of A ) seems to own the ...

95. How to handle this type of many-to-many relationship?    forum.hibernate.org

I have a many-to-many relationship in the same scenario as the followings: A person has a set of characters, such as smart, thoughtful, tall, slim, etc. The character set is not pre-definited in the system. When a user submits a person information, this user must also provide this person's character. If the character description such as "smart" is not in the ...

96. Help in XML import with many-to-one relationship    forum.hibernate.org

I am trying to import an object that has got mapping from an XML. Following is my xml: 16 Infrastructure Infrastructure 4 The maping file of the above object as follows:

97. Custom persister and many-to-one relationship    forum.hibernate.org

98. Many-to-many relationship help from a newbie.    forum.hibernate.org

I need help getting many to many relation to work. my mapper file looks like ...

99. Employee-Manager relationships    forum.hibernate.org

Hai, This is related to my previous post: http://forum.hibernate.org/viewtopic.php?t=954696 I have a table EMPLOYEE with the following columns. 1. EmployeeId 2. Employee name 3. ManagerId (Foreign key on the same table's (EMPLOYEE table) EmployeeID) Now I should be able to insert 2 Employee objects First one is the manager of second Employee. When I save an Employee Object1 (Employee who is ...

100. Inversion of Employee-manager relationship !!!    forum.hibernate.org

Hi, Iam able to achieve Employee manager relationship by creating Employee object First and then adding the manager Object to it and getting both objects persisted the right way. refer post: http://forum.hibernate.org/viewtopic.php?t=954771 But I need to create the manager Object first and add employees to the manager object and get them persisted. I should only give session.save(Manager) instead of session.save(Employee). Is ...