-->
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: Getting all class metadata attributes?
PostPosted: Wed Nov 16, 2005 5:48 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
I need to programmatically access the "table" attribute for a given mapped class, in order to provide a generic "assigned" key generator. The key generator has to work this way for legacy reasons :(

Looking at the NHibernate API documentation, the session factory has a method called GetClassMetadata, which returns NHibernate.Metadata.IClassMetadata. Unfortunately, I don't see a property for the table attribute.

Is there any way to get this value through the API (or even the raw XML for the class mapping?)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 7:22 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
OK, I found it ...

NHibernate.Cfg.Configuration has a method called GetClassMapping, which returns NHibernate.Mapping.PersistentClass. All the table and column details are accessible from there.

:?: Why would NHibernate.Cfg.Configuration.GetClassMapping and NHibernate.ISessionFactory.GetClassMetadata return different types, the latter being incomplete?


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.