-->
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: XML Node info from Metadata?
PostPosted: Wed Sep 14, 2005 1:26 am 
Newbie

Joined: Wed Sep 14, 2005 1:11 am
Posts: 1
Is there any way to retrieve the node name from the mappings of an entity and/or a property if using XML data binding in Hibernate 3? I've got a need to do some specialized XML processing not handled by the standard Hibernte XML binding code, so I need to know what the XML node name is from the mapping file.

I looked in the ClassMetadata interface and found nothing. I found

StandardProperty.getNode()

and

EntityMetamodel.getProperties()

but I found no "official" way to access these classes.

I can get from a session factory to the metadata of an arbitrary entity and retrieve ALMOST everything I need using

Code:
     Map metaMap = sessionFactory.getAllClassMetadata();
     for (Iterator iter = metaMap.values().iterator(); iter.hasNext();) {
          ClassMetadata md = (ClassMetadata) iter.next();
          ...
     } // for



but I can't figure out how to get from a session factory to a StandardProperty (or some other class that contains the XML "node" name). Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 2:06 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
org.hibernate.cfg.Configuration.getClassMappings()

-> org.hibernate.mapping.PersistentClass.getEntityName()
or .getProperty(propertyName)

->org.hibernate.mapping.Property.getName()


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.