-->
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.  [ 3 posts ] 
Author Message
 Post subject: retrieve field length of db column mapped to property
PostPosted: Fri May 07, 2004 4:57 am 
Beginner
Beginner

Joined: Tue Aug 26, 2003 9:50 am
Posts: 34
Location: Weiden Opf. / Germany
Hi folks!

With MS SQLServer and the JSQLConnect driver (not sure about other db/driver combos) if a string property of an entity has been set with a value longer than the field in the database, it can not be saved.

I'd would like to truncate the String to the length of the db column. Unfortunately i couldn't find any way in hibernate to access the metadata of a db table.

Is there any possibility to retrieve the length the db column mapped to a property?

Any help would be appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 07, 2004 8:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
There is no Hibernate API for that, you can use standard JDBC methods by getting the connection from the session.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 07, 2004 9:24 am 
Beginner
Beginner

Joined: Tue Aug 26, 2003 9:50 am
Posts: 34
Location: Weiden Opf. / Germany
thx a lot! we'll do that.


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