-->
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: Automatic trim
PostPosted: Wed Jun 06, 2007 9:54 am 
Beginner
Beginner

Joined: Thu Aug 19, 2004 5:36 am
Posts: 30
Location: Italy
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.2

Hi all,

I'm writing an application that read and write data to a legacy Informix 7 SE database.

This database does not support VARCHAR but only CHAR. So when I load an object all String properties are filled with empty spaces up to the length of the char field in database.
This is VERY annoying.

Is there a place (in dialect or somewhere else) to instruct Hibernate to make a trim before filling object properties at load time?

Thanks


Top
 Profile  
 
 Post subject: Re: Automatic trim
PostPosted: Wed Jun 06, 2007 10:04 am 
Regular
Regular

Joined: Fri May 12, 2006 4:05 am
Posts: 106
delta wrote:
Is there a place (in dialect or somewhere else) to instruct Hibernate to make a trim before filling object properties at load time?


Yes, there is: build yourself a UserType that does the work for you.
Luckily ,since this is a very common problem, someone has already done this. Just have a look at this thread.


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.