-->
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: One-to-many with SortedSet key column set to NULL
PostPosted: Mon Oct 24, 2005 3:10 am 
Newbie

Joined: Thu Oct 20, 2005 11:52 am
Posts: 6
Hi,

I have a SortedSet with the following comparator (specified in code and in the mapping file)



Code:
public class CloseDateDescComparator implements Comparator<Order> {
  public int compare(Order o1, Order o2) {
    int i = o1.getCloseDate().compareTo(o2.getCloseDate());
    if (i==0) i =-1;
    return i;
  }
}


This SortedSet is a field on a SalesEmployee (called deals). This deals is mapped as a unidirectional one-to-many:
Code:
<set name="deals" cascade="all,delete-orphan" sort="demos.inheritance.single.CloseDateDescComparator">
      <key column="SALES_ID"/>
      <one-to-many  class="demos.inheritance.classtable.Order" />
    </set>


When i add two orders to the Set with the same closeDate, the first to insert has NULL has it's SALES_ID (the second correctly has the SALES_ID set to the corresponding ID of the SalesEmployee).

Any thoughts?

Tx.,

Raphael


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 01, 2006 12:18 am 
Newbie

Joined: Fri Mar 31, 2006 11:35 pm
Posts: 2
Hi,

I'm seeing the same behaviour, and would appreciate any feedback as to what could cause this?


Dean


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.