-->
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.  [ 9 posts ] 
Author Message
 Post subject: Usage of EntityPersister
PostPosted: Mon Oct 06, 2003 12:25 pm 
Regular
Regular

Joined: Mon Sep 08, 2003 4:53 am
Posts: 70
Location: Germany
Hi Hibernate Team,

is it recommended to use the EntityPersister to get the database table of a class like this:

Code:
Map info = hibernateSessionFactory.getAllClassMetadata();
ClassMetadata metadata = (ClassMetadata) info.get(clazz);
EntityPersister persister = (EntityPersister) metadata;
String tablename = persister.getTableName();


Or is this something internal, that's better not used?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 06, 2003 2:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Don't do this.


You can use Configuration.getClassMapping()


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2003 5:46 am 
Regular
Regular

Joined: Mon Sep 08, 2003 4:53 am
Posts: 70
Location: Germany
Is there another way, to get the tablename? Cause I only have the sessionFactory to get information from.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2003 5:48 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Looks like we have another +1 on the feature list for SessionFactory.getConfiguration() :)

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2003 6:11 am 
Regular
Regular

Joined: Mon Sep 08, 2003 4:53 am
Posts: 70
Location: Germany
Yes, this would be the feature I need. Thanks! :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2003 3:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No way, there will be no SessionFactory.getConfiguration(). It makes no sense, since Configuration is mutable and SessionFactory is immutable. The SessionFactory represents a "frozen" Configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2003 3:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
A valid point - so, if users want this (and they want ;) - they should just keep a map from SessionFactory to a Configuration ....easy to do !

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 08, 2003 7:19 am 
Regular
Regular

Joined: Mon Sep 08, 2003 4:53 am
Posts: 70
Location: Germany
max wrote:
A valid point - so, if users want this (and they want ;) - they should just keep a map from SessionFactory to a Configuration ....easy to do !


Hm, I don't see, why keeping the Configuration in a Map should be better than sessionFactory.getConfiguration(). If I get the Configuration from the Map, I can't be sure, that the Configuration hasn't changed since the sessionFactory was created.

If I get the "frozen" Configuration from the sessionFactory it would be better in my opinion.


Top
 Profile  
 
 Post subject: Configuration when using Hibernate as JMX in JBOSS
PostPosted: Wed Dec 17, 2003 7:59 pm 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Since Configuration object is not available in this case, we need to have some kind of metadata classes from SessionFactory to know the information of the columns like ColumnMetaData from SessionFactory.

We really need some kind of facility where we can have acces to whole mapping file from SessionFactory.

This can be really helpful when we are automating the request(web tier) mapping into hibernate objects.

Thanks


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