-->
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.  [ 5 posts ] 
Author Message
 Post subject: Avoid loading hibernate.properties
PostPosted: Mon Jul 11, 2005 1:18 am 
Newbie

Joined: Sun Jul 03, 2005 10:23 pm
Posts: 4
Location: Russia
Hi all!

I want to avoid loading of hibernate.properties while creating instance of Configuration class. Is it possible? (This file is in the root of my classpath).

Sincerely,
Igor Deruga

Hibernate version: 3.0

_________________
Sincerely,
Igor


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 5:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
dont put it there in the first place ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 5:58 am 
Newbie

Joined: Sun Jul 03, 2005 10:23 pm
Posts: 4
Location: Russia
Well, thanks, max!

I would do it this way, but circumstances don't allow me to do so. I have that "bad" config file in the root of the classpath, and I can't move it. I'm surprised that Configuration class doesn't have a constructor that takes an URL or File parameter. I thought someone would have needed it long time ago.

Any other ideas?

max wrote:
dont put it there in the first place ;)

_________________
Sincerely,
Igor


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 6:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well, put the properties in a cfg.xml and use one of the methods to load it explicitly and it will override settings in global defined hibernate.properties

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 6:25 am 
Newbie

Joined: Sun Jul 03, 2005 10:23 pm
Posts: 4
Location: Russia
That's a good decidion, but it doesn't fit either. I'll explain situation. I have a webapp that uses main configuration file to work with MS SQL server. And I have a test method that is supposed to use an in-memory database (HSQL DB) to test some queries. But when I create configuration instnace (new Configuration()), it loads the main config file and throws some exceptions because environment doesn't contain necessary settings.

That's the reason I need to load _only_ my configuration file.

max wrote:
well, put the properties in a cfg.xml and use one of the methods to load it explicitly and it will override settings in global defined hibernate.properties

_________________
Sincerely,
Igor


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