-->
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: Using SQL 'CAST' in 'order-by' for set's
PostPosted: Fri Feb 18, 2005 6:22 am 
Newbie

Joined: Fri Feb 18, 2005 5:09 am
Posts: 1
Hibernate version: 2.1.7

MySQL 4.1.7-Max-log

Hi There

I have scoured the net in search of an answer to my question and came up empty handed so if someone could help me out that would be great:

I would like to use the SQL 'CAST' function for the 'order-by' option of a hibernate 'set' mapping:

<set
name="pointsOfSale"
lazy="false"
inverse="true"
cascade="none"
sort="unsorted"
order-by="cast(client_identifier as unsigned)"
where="deleted is null"
>

client_identifier is a varchar(255)

I need to do this so I can order the column based on it's numerical values.

This however doesn't work for me, i get an sql grammar exception. Is there another way to do this in hibernate with set relations?

Regards
Mark Linley


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.