*
The moose likes Object Relational Mapping and the fly likes App Config files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "App Config files " Watch "App Config files " New topic
Author

App Config files

Malatesh Karabisti
Ranch Hand

Joined: Jul 28, 2010
Posts: 153

Hi All,

I have to requirement like where in I need to read the configuration files. probably configuration files are XML and again I am free to choose the type of the configuration file.

Can I use the JPA to read the application configurations ? I don't want to use the DB to save the configurations How can I achieve this ?

Please suggest.
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
If you want to read XML files and convert them to objects, I would recommend JAXB. It is the standard for object-xml mapping.

EclipseLink Moxy supports JAXB and object-xml mapping.

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Is this a Spring framework application?

If so, you could extend PropertyPlaceHolderConfiguration and implement InitializingBean.

This will allow you to "inject" properties from either .properties files, xml, or DB.

We use this to maintain one single code-base packaged as a war and started pointing to one of many config files.

Pat.
Malatesh Karabisti
Ranch Hand

Joined: Jul 28, 2010
Posts: 153

Thanks for your reply, currently I am not using the Spring Frame work
 
 
subject: App Config files