-->
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: how to access dbFieldProperties (e.g. get length of a vChar)
PostPosted: Thu Apr 14, 2005 5:06 am 
Newbie

Joined: Thu Apr 14, 2005 4:04 am
Posts: 2
Hi all,

is there a way to find out about the specs of different database.table.fields from within java code?!

i found out how to get the type and the nullable settings of a field via

SessionFactory.getClassMetaData(Class)....

but is it also possible to get for example the allowed lenght of a varChar, or the allowed values of a selection (gender filed => "m" or "f")

thanx for you help in advance.

dom_bus


Hibernate : 2.1.7c

Database : Oracle 9i and DB2 8.1.5


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 14, 2005 5:18 am 
Senior
Senior

Joined: Tue Aug 03, 2004 2:11 pm
Posts: 142
Location: Somerset
http://java.sun.com/j2se/1.4.2/docs/api ... aData.html

Not sure if you can get the equivalent from Hibernate as in yuor mapping files you don't have to specifiy the length of columns and so ob.

_________________
On the information super B road


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 14, 2005 1:57 pm 
Newbie

Joined: Thu Apr 14, 2005 4:04 am
Posts: 2
Thanx Paul for the tip.

I think getColumns() will do the job for me.

Greetz, dom_bus


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.