-->
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.  [ 4 posts ] 
Author Message
 Post subject: Finding details of underlying DB data types
PostPosted: Wed Jul 27, 2005 12:53 pm 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
I'm wondering whether there's a way to obtain the details of the database fields that are mapped to the properties of an NHibernate entity.

For example, I want to find out the length of a varchar field in the database that maps to a 'name' field at runtime so that the UI of the application can dynamically determine the length of a text field to display, thereby preventing the user from entering a value that will cause a runtime exception when trying to persist the value.

I know that there are methods on the SessionFactory which allow you to obtain metadata on the registered classes, but so far I haven't been able to find the information I'm looking for.

Has anyone out here worked out how to do this?

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 3:51 am 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
Just re-raising this one since it's been about a week and the forums have been a bit unreliable.

Is there any way to access details of the database schema (varchar length, float precision, etc) from the NHibernate metadata?

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 03, 2005 6:40 am 
I've read in Hibernate.org about sessionfactory.getClassMetadata - is here in NHibernate something simmilar, too?


Top
  
 
 Post subject:
PostPosted: Sat Sep 03, 2005 10:03 am 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
There is a metadata method on the session factory, but it doesn't actually contain information about the database read from the database, only information inferred through the mapping files and reflection, or so it appears.

:(

Symon.


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