-->
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: length attribute of mapping file
PostPosted: Fri Sep 29, 2006 6:53 am 
Newbie

Joined: Fri Sep 29, 2006 5:20 am
Posts: 8
if have the following mapping file:
Code:
... <property name="xx" type="java.lang.String" length="100" ...

Is there a possibility to get the value for the length attribute via Hibernate (SessionFactory, MetaData etc.)?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 7:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no, it is not needed at SessionFactory runtime so are only available on the Configuration object

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 8:03 am 
Newbie

Joined: Fri Sep 29, 2006 5:20 am
Posts: 8
you mean use class Property. But there is no getLength() or somthing like that.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 8:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no, because it is actually on the column which is availble through the Value of a property.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 9:09 am 
Newbie

Joined: Fri Sep 29, 2006 5:20 am
Posts: 8
Thanks:
Code:
Configuration ncf = ...;
PersistentClass pc = ncf.getClassMapping("dao.Car");
Property p = pc.getProperty("name");
Value v = p.getValue();
      
Iterator i = v.getColumnIterator();
Column c = (Column) i.next();
int length = c.getLength();
      
System.out.print(length);


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.