-->
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: Mapping legacy schema and classes
PostPosted: Mon May 14, 2007 9:53 am 
Newbie

Joined: Wed Dec 15, 2004 1:58 pm
Posts: 16
Location: Prague, Czech Republic
I've got a legacy object structure like this:

Code:
public class FirstClass {
 
   Set<Child> children;
}

public class SecondClass {
 
   Set<Child> children;
}

public class Child {

  Set<GrandChildren> children;

}


FisrtTable:
primary key (id);

FirstTableChild
  primary key(ch_id)
  foreign key fk_id

FirstGrandChildren
  primary key(gr_ch_id)
  foreign key fk_ch_id


SecondTable:
primary key (id)

SecondTableChild
  primary key(ch_id)
  foreign key fk_id

SecondGrandChildren
  primary key(gr_ch_id)
  foreign key fk_ch_id


We are considering using Hibernate as new persistent layer, but don't know how to map above mentioned structure.

I cannot use <composite-element /> because it does not support set as property.
I cannot use <set /> without composite, because GrandChildren is stored in two tables... and Hibernate cannot map one classes in more contexts into another tables.

Can anybody help me, please?


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.