-->
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.  [ 2 posts ] 
Author Message
 Post subject: Custom Properties for the hbm2cfgxml inside Hibernate Tools
PostPosted: Fri Sep 16, 2016 2:55 pm 
Newbie

Joined: Thu Sep 08, 2016 7:02 pm
Posts: 5
We have a Hibernate Tools automated job running each night to pick up entity changes to our database structure. We also run hbm2cfgxml to pick up new entities to add to cfg. However we can't run hbm2cfgxml as an automated task because Hibernate Tools can't run under jndi and our app runs under jndi. That means the hibernate.properties file used for the tool and the expected hibernate.cfg.xml for the actual app have different connection settings.

This seems like it should be an easy problem to solve. We need to add customize the properties outputted fromhbm2cfgxml, and the HibernateConfigurationExporter has a customProperties field. However that customProperties field doesn't seem to be accessible from our ant job(the ant job is called from maven).

Does anyone have a suggestion for how to customize the generated hibernate.cfg.xml from Hibernate Tools?


Top
 Profile  
 
 Post subject: Re: Custom Properties for the hbm2cfgxml inside Hibernate Tools
PostPosted: Tue Sep 27, 2016 5:57 pm 
Newbie

Joined: Thu Sep 08, 2016 7:02 pm
Posts: 5
Perhaps there can be a different way of looking at the problem.

I have a hibernate.properties file with the connection information for my server. That isn't the connection information I want to use for the cfg.

Can I have the intended connection information for the cfg be present in the hibernate.properties file, but with different connection information used by the system?

I was trying to use ReverseEngineeringRuntimeInfo, which seemed to work somewhat but somewhere in the system, it would try to instantiate the jndi I had put in the properties file, though I had only intended it for the cfg.

Any help would be greatly appreciated!


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