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: Read in the ClassMetadata the BasicEntityPropertyMapping.
PostPosted: Thu Jun 14, 2007 5:40 am 
Newbie

Joined: Mon Sep 18, 2006 3:33 pm
Posts: 6
Hi

I try to read information about different class of my project.
To do so, i use, for example, the following code.

[code]
ClassMetadata metadata = sessionFactory.getClassMetadata(IhmAllTabColumns.class);
[/code]

when i look at the metadata object, in debug mode, i see
there is property whose name is '[b]propertyMapping[/b]'.
It's an instance of BasicEntityPropertyMapping.

When i look inside this class, i see the property
'[b]columnsByPropertyPath[/b]' which is a Hashmap

I would like to be able to read this Hashmap.
How could i do that with the Hibernate Api ?

Thanks for anyone who can help me :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 14, 2007 5:51 am 
Newbie

Joined: Mon Sep 18, 2006 3:33 pm
Posts: 6
I forget to explain the reason why i try to read this information.

In fact, i only try to have the link between a class property and
his column name in a database table..

So, in fact, if anyone has a solution to obtain the class name of a
property with the table name in the database and the opposite too
i will really be glad :)

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 14, 2007 7:43 am 
Newbie

Joined: Mon Sep 18, 2006 3:33 pm
Posts: 6
Hi it still me :)

I do the question and the answer. (That's really funny)

So, maybe is this not really good code, in this case don't
hesitate to send me your own suggestion.

Here is how i have resolve my problem.

Code:
AbstractEntityPersister aep = (AbstractEntityPersister) sessionFactory.getClassMetadata(IhmAllTabColumns.class)


Still thanx to Hibernate team for this good product.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 4:02 am 
Newbie

Joined: Mon Sep 18, 2006 3:33 pm
Posts: 6
Everything i needed was in the Configuration object.

:(

I have looked first, but was in a hurry ...
Now i am relax, i discover it is where it have to be, i mean in the Configuration object.

:)

What a wonderful world ...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 4:44 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
nicolas.fontanie wrote:
Everything i needed was in the Configuration object.

:(

I have looked first, but was in a hurry ...
Now i am relax, i discover it is where it have to be, i mean in the Configuration object.

:)

What a wonderful world ...

could u explain me how u get he configuration object?
I have the same prob


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.