-->
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: required <index tag in <list and multiple <index ta
PostPosted: Tue Jul 20, 2004 6:38 am 
Newbie

Joined: Tue Jul 20, 2004 6:08 am
Posts: 4
Hi,

I have been mapping a legacy data structure using Hibernate (latest version) and I came across a possible limitation that I'm looking for a simple workaround for.

I would like to use multiple <index> tags within the <list> structure to order related records by more then one field.

Like this:

Code:
    <list name="CommercialUsage" lazy="true">
      <key column="CommercialID"/>
      <index column="UsageDate"/>
      <index column="UsageTime"/>
      <one-to-many class="CommercialUsage"/>
    </list>


(I can not change the database to use a Timestamp field and I have more of these that have nothing todo with date/time).

I know that its possible to create a special collator/comparator but I want to avoid that if possible.

Best regards,
-Stefan


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 8:39 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is not possible but you can use a DB view to concatenate the 2 index columns

_________________
Emmanuel


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.