-->
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: Binding HBM files dynamically.
PostPosted: Mon Jul 07, 2008 2:48 am 
Newbie

Joined: Thu Feb 22, 2007 6:42 am
Posts: 9
Hibernate version:
3.2

Code between sessionFactory.openSession() and session.close():
using spring for sessionfactory

Name and version of the database you are using:
MySQL 5.2 --- MS-SQL 2005

I need to deploy the same application at multiple servers ... some servers are having MySQL at backend and some are having MS-SQL at their backend.

The problem is that for every deployment i have to change in applicationContext.xml (spring based file using for hibernate). Is there any way that i can use conditional hbm binding for JAVA OBJECT and DB TABLES. I am having dialect, username, password settings in .properties file i need to know that whether that property file will help me to bind corresponding hbm depending upon backend DB?

Since the table names are different in MySQL and MS-SQL and so are column names. for MySQL i am having mysql-emplyee.hbm.xml and for ms-sql i am having mssql-employee.hbm.xml.


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.