-->
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: Specifying which hibernate.properties to use with jpaconfig
PostPosted: Tue May 01, 2007 4:52 pm 
Newbie

Joined: Tue May 01, 2007 2:59 pm
Posts: 4
Location: San Jose, CA
Hi,

I need to write ant tasks to generate DDL for two different databases (Oracle for production, hsqldb for unit testing). I have two different properties files with the respective database connection info (hibernate-oracle.properties and hibernate-hsqldb.properties), but I'm using jpaconfiguration so there doesn't seem to be any way to tell Hibernate which .properties file to use. The only reason I am using jpaconfiguration is to get the auto-scanning for annotated classes.

I'm new to Hibernate, but the only solutions I can think of are:

1- Put each .properties file in a different directory and manipulate the htools classpath so that Hibernate only finds the .properties I want to use (seems like an ugly hack)

2- Use annotationconfiguration instead of jpaconfiguration and manually specify (in hibernate.cfg.xml) all of my Entity classes (yuk).

Is there some other way to tell Hibernate which hibernate.properties to use (or some other way to specify the hibernate.connection and hibernate.dialect properties) when using jpaconfiguration?

Thanks,
Todd Klaus
Kepler Space Telescope
http://kepler.nasa.gov


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.