-->
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.  [ 8 posts ] 
Author Message
 Post subject: Bug?: No properties (overrides) for JPAConfiguration
PostPosted: Wed Jan 24, 2007 12:56 pm 
Newbie

Joined: Fri Feb 17, 2006 4:46 am
Posts: 10
Currently, in JPAConfigurationTask the first line in createConfiguration() is
Code:
Map overrides=new HashMap();

It instantiates override properties but never initializes this HashMap.
So, there is no way for the ant task to control overrides. This is a problem if you want to change JPA behavior from outside the persistence.xml file (which is the purpose of overrides).

I think changing the above line to something like this should fix the problem:
Code:
Properties overrides= new Properties();
File propertyFile=getPropertyFile();
if (propertyFile!=null) {
   try {
      overrides.load(new FileInputStream (propertyFile) );
   }
   catch (FileNotFoundException e) {
      throw new BuildException(propertyFile + " not found.",e);               
   }
   catch (IOException e) {
      throw new BuildException("Problem while loading " + propertyFile,e);         
   }
}

Then you could do something like this in your ant file:
Code:
<jpaconfiguration persistenceunit="..." propertyfile="..."/>

which is basically accepted already now except that propertyfile is ignored which it shouldn't.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 24, 2007 1:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
submit a patch (and hopefully extend the test case too) and i'll apply it

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 4:29 am 
Newbie

Joined: Fri Feb 17, 2006 4:46 am
Posts: 10
max wrote:
submit a patch (and hopefully extend the test case too) and i'll apply it

I might - if I knew how to do that. I've only tried it out by subclassing the relevant classes in a new project and overloading the affected methods. It worked perfectly fine but I have no idea how to officially submit the change.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 6:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
create a patch (cvs diff ...)

submit it to our jira

done ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 7:27 am 
Newbie

Joined: Fri Feb 17, 2006 4:46 am
Posts: 10
Due to company firewall settings, I have no access to the CVS repository. I can only download individual source files via http. I'm not sure how/if I can create a patch in an evironment like that (we are using clearcase so I'm not a cvs/svn expert).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 7:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - I felt sorry for you and did http://opensource.atlassian.com/project ... se/HBX-861 and http://opensource.atlassian.com/project ... se/HBX-862

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 7:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. i mistyped before...its not in cvs, but in SVN (don't know if that helps you through the firewall ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 7:53 am 
Newbie

Joined: Fri Feb 17, 2006 4:46 am
Posts: 10
max wrote:

Thanks! :)
max wrote:
btw. i mistyped before...its not in cvs, but in SVN (don't know if that helps you through the firewall ;)

Unfortunately doesn't make a difference, svn, cvs, all blocked.


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