-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping Repeating Fields
PostPosted: Tue Feb 15, 2011 3:58 pm 
Newbie

Joined: Tue Feb 15, 2011 3:18 pm
Posts: 2
I've searched the internet over and cannot find anyone even asking this question. I assume that I'm just not searching for the right phrase. Others must have had this problem. I am mapping a legacy database that has repeating fields. (below) I'd like to map them as a List of Parts within a List of Segments but can't figure it out. One idea I had was to map the DB fields to object fields directly and then write methods on the object which return the components as a list. However, if NHibernate has builtin support for what I want to do I'd rather use that.

Thanks in advance!

public Class MainObject() {
List<Segments> _segments;
}

public Class Segment() {
List<Part> _parts;
}

...other fields...
Seg1_Part1_Type
Seg1_Part1_Start
Seg1_Part1_Length
Seg1_Part2_Type
Seg1_Part2_Start
Seg1_Part2_Length
...
Seg2_Part1_Type
Seg2_Part1_Literal
Seg2_Part1_Start
Seg2_Part1_Length
Seg2_Part2_Type
Seg2_Part2_Literal
Seg2_Part2_Start
Seg2_Part2_Length
...
etc


Top
 Profile  
 
 Post subject: Re: Mapping Repeating Fields
PostPosted: Sun Feb 27, 2011 4:09 pm 
Newbie

Joined: Tue Feb 15, 2011 3:18 pm
Posts: 2
Nice! Exactly what I was hoping for. Will try it out once I finish getting my model hooked up to SilverLight.


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

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.