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.  [ 3 posts ] 
Author Message
 Post subject: List that does not begins with 1
PostPosted: Thu Apr 24, 2008 2:44 am 
Newbie

Joined: Wed Jan 31, 2007 8:44 am
Posts: 9
Hi to everyone,

I have a mapping where order has a list of orderLines that should be ordered, I have a field in the Database that stores sequential order, but it begins with 1. The relevant part of the mapping is

Code:
<list name="OrderLines" table="MA_SaleOrdDetails"  lazy="true" >
      <key column="SaleOrdId" />
      <index column="Line" type="Int16" />
      <composite-element class="OrderLine">
        <property name="Cancelled" type="Char" column="Cancelled" />


clearly, since nhibernate does not found the element marked with 0, my orderLines list always begins with a null'element.
Is there a way to tell nhibernate that in database the index field begins with 1?

Thanks.

Alk.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 2:51 am 
Regular
Regular

Joined: Thu Mar 06, 2008 5:06 am
Posts: 68
That's not possible. The index is used as key in your list. And every list in .NET begins with zero...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 3:11 am 
Newbie

Joined: Wed Jan 31, 2007 8:44 am
Posts: 9
Thanks for the answer.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.