-->
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: Howto get the "type" field of a property block ?
PostPosted: Tue Apr 06, 2004 9:38 am 
Beginner
Beginner

Joined: Fri Mar 05, 2004 11:14 am
Posts: 38
Location: Houston, Texas
This seams like a trivial question - but I havent found a way around it yet - 100% me beeing stupid ... but anyhow ... Suppose I have

<property
name="description"
column="DESCRIPTION"
type="java.lang.String"
length="2000"
/>

And I have name of th eproperty in my hand - how do I get the info that this property has type "String" ?

Type hbmType = _hbmClassMetadata getPropertyType(propertyName);

is not helping me since that just gives me the Hibernate Type object which still doese not inform me of WHAT type it is.

The Hibernate type system seams so rich so I must have missed something here ... any examples somewhere how to use this correctly ?

Thanx
B-)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 06, 2004 10:13 am 
Beginner
Beginner

Joined: Fri Mar 05, 2004 11:14 am
Posts: 38
Location: Houston, Texas
Ok - stupid me -

Type hbmType = _hbmClassMetadata getPropertyType(propertyName);
String typeName = hbmType.getName();

Will return "string" for java.lang.String, "timestamp" for java.sql.Timestamp

.. that will do it ...
B-)


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.