-->
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: cast to VARCHAR(1024) in hql
PostPosted: Wed Nov 12, 2008 3:10 pm 
Newbie

Joined: Fri Nov 17, 2006 9:40 am
Posts: 11
Location: Switzerland
Hi all

I've got a CLOB field (DB type 'TEXT') on one of my tables. For one query, I need to use this field in a group-by statement (yes, this in itself suggests a questionable design, but we don't live in a perfect world). Using Sybase ASE, the DBMS does not allow for TEXT columns in a group by clause. Therefore, I'd like to cast the field to a varchar. If I use

Code:
cast(tbl.MYCLOBFIELD, string)


Hibernate will translate that to a cast to VARCHAR(255). What is required to force a cast to VARCHAR(1024) (or any length other than 255)?

I assume it doesn't matter, but in the HBM my field is mapped as:

Code:
<property name="clobField" type="string" column="MYCLOBFIELD" />


Thanks a lot
Simon Niederberger


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.