aspose file tools*
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
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: 860

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: App Config files
 
Similar Threads
Can we use additional properties files?
Multiple persistence units with different column mappings
4.2.3 issues with Mac OS X (JDK 1.6)
creating configuration programmatically in JAAS
How to implement XML in Web App