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.  [ 3 posts ] 
Author Message
 Post subject: Does hibernate config support import other xmls
PostPosted: Tue Apr 15, 2008 11:49 pm 
Regular
Regular

Joined: Sun Apr 13, 2008 3:04 am
Posts: 71
Location: Bangalore
Like ant, does hibernate support import of another subset config..
This would ease xml configuration maintance. e.g

some thing like this

main.cfg.xml:

?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<import file="mysql.xml"/>
</session-factory>
</hibernate-configuration>

mysql.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
org.gjt.mm.mysql.Driver
</property>
<property name="hibernate.dialect">
com.tejasoft.utils.hibernate.TejaSQLDialect
</property>
<property name="hibernate.connection.username">tezzd</property>
<property name="hibernate.connection.password">abc123</property>
<property name="hibernate.connection.autoReconnect">true</property>
<property name="hibernate.connection.pool_size">4</property>
</session-factory>
</hibernate-configuration>

_________________
Raja Nagendra Kumar,
C.T.O
http://www.tejasoft.com
TejaSoft - Specialists in Code Audit, Unit Testing and Merciless Re-factoring - Engineering Crisis Turnaround Experts


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 12:03 am 
Beginner
Beginner

Joined: Wed Mar 05, 2008 4:57 am
Posts: 22
Location: Bangalore,India
As of now, Hibernate does not support import of xmls.

_________________
Naresh Waswani
+91-9986461501


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 1:43 am 
Regular
Regular

Joined: Sun Apr 13, 2008 3:04 am
Posts: 71
Location: Bangalore
Any plans to support his in future.. this is a very import and simple feature and could help a lot in xml file maintance..

I see it supports this feature in programatic way some thing like this..

Configuration lConf = new AnnotationConfiguration();
lConf.configure("/resources/hibernate.common.cfg.xml");
lConf.configure(
ConfigHelper.locateConfig("resources/hibernate.cfg.xml"));
sessionFactory = lConf.buildSessionFactory();

Exposing this in xml tag way would be a nice to see in near feature..

Regards,
Nagendra

_________________
Raja Nagendra Kumar,
C.T.O
http://www.tejasoft.com
TejaSoft - Specialists in Code Audit, Unit Testing and Merciless Re-factoring - Engineering Crisis Turnaround Experts


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