-->
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.  [ 5 posts ] 
Author Message
 Post subject: Saving values automatically in uppercase.
PostPosted: Fri Jul 13, 2007 3:32 am 
Newbie

Joined: Thu Mar 22, 2007 6:36 am
Posts: 7
Hibernate version:
3.2.2.ga

There is a configuration that can be used to automatically perform the uppercase of string data when pojos are persisted into the database?

For example to obtain insert/update statements like this:
INSERT INTO [...] VALUES (UPPER(?), UPPER(?), [...])

Thanks.
Luca.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 3:45 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

in mapping file use

<sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</sql-insert>

Amila

(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 4:06 am 
Newbie

Joined: Thu Mar 22, 2007 6:36 am
Posts: 7
Thanks, this could be a solution, but doing like this, every time that i change the mapping i need also to align the insert statement (and afaik, i will lost the DB indipendence).

If there is a way to do this specifying an attribute in mapping files for each property that i need to persist in uppercase would be great.

Thanks.
Luca.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 5:29 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

Use cutom PropertyAccessor class for uppercase properties


Amila

(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 6:25 am 
Newbie

Joined: Thu Mar 22, 2007 6:36 am
Posts: 7
Thanks Amila!

This is what I was looking for!

Bye.
Luca.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.