-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem with list index
PostPosted: Wed Sep 10, 2003 9:04 am 
Newbie

Joined: Wed Sep 10, 2003 8:56 am
Posts: 3
Hi,

I have a simple data amodel with orders and orderlines:

Code:
<class name="tuhh.aea.mapping.Order" table="hn_orders">
    <id name="orderID">
      <generator class="native"/>
    </id>
    <property name="datum"/>
    <many-to-one name="client" column="client_id"/>
    <list name="orderlines" inverse="true" cascade="all-delete-orphan">
       <key column="order_id"/>
       <index column="orderline_number"/>
       <one-to-many class="tuhh.aea.mapping.Orderline"/>
    </list>
  </class>


  <class name="tuhh.aea.mapping.Orderline" table="hn_orderlines">
    <id name="orderlineID">
      <generator class="native"/>
    </id>
    <property name="quantity"/>
    <many-to-one name="product" column="product_id" not-null="true"/>
    <many-to-one name="order" column="order_id" not-null="true"/>
  </class>


Everything works fine, except that after an insertion of an order with
orderlines, the column 'orderline_number' does not get a value,
everything else is fine. In my Order class I do not mention
'orderline_number' at all. Is this OK? Any hints are wellcome. I am
using version 2.0.2/2.0.3.

Thanks a lot

volker turau


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 9:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
http://forum.hibernate.org/viewtopic.php?t=330


Top
 Profile  
 
 Post subject: Problem with list index
PostPosted: Wed Sep 10, 2003 9:21 am 
Newbie

Joined: Wed Sep 10, 2003 8:56 am
Posts: 3
gavin wrote:
http://forum.hibernate.org/viewtopic.php?t=330


I read that posting, but I cannot understand it. What do I have to change to get my code work? Do I have to have an instance variable with the name of the index column? Do I have to provide a value for that variable? Note that in contrast to the referred posting I have inverse="true"

Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 9:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Do I have to have an instance variable with the name of the index column? Do I have to provide a value for that variable?


Yup.

Quote:
Note that in contrast to the referred posting I have inverse="true"


I strongly suspect that that poster also really has inverse="true"


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