-->
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: Recursive Association without Foreign Keys
PostPosted: Thu Feb 19, 2009 6:02 am 
Beginner
Beginner

Joined: Thu Feb 19, 2009 5:48 am
Posts: 37
Location: Glasgow, Scotland
Hey guys,

Just new here, I get the feeling I'll be a regular. I'm pretty new to Hibernate. I've looked through the forum and can find nothing like what I'm looking for.

I'm using Maven to construct a Hibernate through Spring to PostGres database. I've been given the database schema and I'm trying to map my domain objects to it and having a little trouble. Just wondering if anyone is able and willing to help me understand Hibernate a little better.

My domain object "Layer" has it's own "Layer" objects but instead of having a FK in the sub layer rows, we have a field in the super layer row which contains a comma separated list of all the names of the sub layers (which also happen to be the primary keys). My understanding of Hibernate isn't the best but I'm struggling to find anything that can handle this elegantly.

I was thinking of a UserType which reads the comma separated list of layers and returns a list of Layer objects but once we are inside the UserType and have extracted the list of layer names, how do we get the information for the sub layers?!?!

Anyone any ideas or am I missing something?


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.