-->
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.  [ 1 post ] 
Author Message
 Post subject: How to get Configuration from JNDI bound SessionFactory?
PostPosted: Fri Dec 17, 2004 1:15 pm 
Newbie

Joined: Fri Dec 17, 2004 12:55 pm
Posts: 1
Location: Rhode Island,US
Hi,
I have the sessionFactory bound to the JNDI as shown below

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory name="hibernate/SessionFactory">
<property name="connection.datasource">java:comp/env/jdbc/esdb</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<mapping resource="mapping.hbm.xml"/>
</session-factory>
</hibernate-configuration>

In my code i need to get some mapping information which is stored in the configuration object. (e.g. the primaryKey of the table of a class), so I would call "(configure.getClassMapping(testClass)).getTable().getPrimaryKey()"

But for invoking this I need to have the Configuration object. So is there a way to get the configuration object to which the sessionFactory object is bound to?

_________________
Thanks and Regards,
Nagarajan B N


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.