-->
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.  [ 6 posts ] 
Author Message
 Post subject: Getting Metadata Out Of XML Mappings
PostPosted: Wed Oct 27, 2004 3:45 pm 
Beginner
Beginner

Joined: Fri Oct 22, 2004 4:47 pm
Posts: 22
Can anyone tell me if there is a way to get the MetaData from the Hibernate XML mappings? Here is some psudo code of what I am trying to accomplish



Code:

MetaData mymetadata = new MetaData(MyClass)
mymetadata.getTableName()
mymetadata.getColumnName("myClassProperty");



I am trying to get this history interceptor working. I have it determining changes, but I would like to have the table name and columns names that the change is taking place in, instead of the property's from the class.

http://www.hibernate.org/195.html


Thanks,

Paul


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 4:01 pm 
Regular
Regular

Joined: Wed Jan 07, 2004 5:16 pm
Posts: 65
Location: CA, USA
Try looking at:
Code:
ClassMetadata meta = sessionFactory.getClassMetadata(YourClass.class);


and then look in the API from there to find what you want. I'm not sure (from a quick look) that the ClassMetadata class exposes the info that you need though...

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 4:10 pm 
Beginner
Beginner

Joined: Fri Oct 22, 2004 4:47 pm
Posts: 22
I was looking at this, and it does not look like it provides what I am looking for. It looks like it is returning the properties that are in the class and their types.

Thanks,

Paul


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 28, 2004 6:12 am 
Beginner
Beginner

Joined: Fri Oct 22, 2004 4:47 pm
Posts: 22
Does anyone have any other ideas? I can't believe that this functionality would not be provided.

Thanks,


Paul


Top
 Profile  
 
 Post subject: Re: Getting Metadata Out Of XML Mappings
PostPosted: Thu Oct 28, 2004 7:11 am 
Newbie

Joined: Thu Oct 21, 2004 10:45 am
Posts: 11
zepernick wrote:
Can anyone tell me if there is a way to get the MetaData from the Hibernate XML mappings? Here is some psudo code of what I am trying to accomplish



Code:

MetaData mymetadata = new MetaData(MyClass)
mymetadata.getTableName()
mymetadata.getColumnName("myClassProperty");



I am trying to get this history interceptor working. I have it determining changes, but I would like to have the table name and columns names that the change is taking place in, instead of the property's from the class.

http://www.hibernate.org/195.html


Thanks,

Paul


Have a look at this thread where my very similar question was answered:

http://forum.hibernate.org/viewtopic.php?t=935738


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 28, 2004 10:06 am 
Beginner
Beginner

Joined: Fri Oct 22, 2004 4:47 pm
Posts: 22
digbyk,

Thanks a million. That was exactly what I was looking for.


Thank,

Paul


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