-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Difficulty in the mapping (composed key)
PostPosted: Wed Oct 03, 2007 10:53 am 
Newbie

Joined: Wed Oct 03, 2007 10:42 am
Posts: 1
Location: Brazil
Hi Friends,

I´m with a great problem.
I have a relationship as represented in figure below:


RELAC_PROJ (N) <--------- (1) PROJECT


I have two relationship one-to-many of Project to Relac_Proj.

In this case, I have the following structure of tables:

Table PROJECT:

"id" and "version" are fields that represent the primary key of table,
composed key (both Integer)

"identification" (String)
... and others


Table RELAC_PROJ:

"id", primary key of table (sequential number - Integer)

"id_importer" and "version_importer" are foreign keys that represent the entity PROJECT "father" of relationship. (both Integer)

"id_imported" and "version_imported" are foreign keys that represent the entity PROJECT "child" related with the entity "father" (both Integer)

... and others

I´d like to relate one entity PROJECT into entity RELAC_PROJ, of form that it represent the entity "father" of my relationship, and in the same one, i´d like to represent another entity PROJECT too, that it´s the child PROJECT of relationship.
For this, i have two objects Project into object RelProjects.

However, at the same time, I need to load into object Project a collection (Set in this case) of the RelProject, that represented through "id_importer" and "version_importer".

Will be that somebody could help me? Please.
Since already i´m thakful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.