-->
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.  [ 1 post ] 
Author Message
 Post subject: Question on sorting with @OrderBy
PostPosted: Tue Aug 17, 2010 10:57 am 
Newbie

Joined: Tue Aug 17, 2010 10:36 am
Posts: 1
I've been trying to get @OrderBy to work on a collection table of Strings.

Code:
@Entity
public class Employee {

  @Id
  @Column(name="EMP_ID")
  private long id;

  @ElementCollection
  @CollectionTable(
        name="PHONE",
        joinColumns=@JoinColumn(name="OWNER_ID")
  )
  @Column(name="PHONE_NUMBER")
  @OrderBy(value="phones")
  private Set<String> phones;
}


This mapping doesn't seem to issue an 'order by' clause to the DB when loading the collection.

However, if I modify the collection to an Embeddable type, the SQL to load the collection will have an order by clause.

Am I missing something here? Is this the expected behavior or is this a bug ? I'm using hibernate 3.5.3-Final...


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

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.