Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing property values in database

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, create an object, and populate that object based on the data in the property files. Then, map the object to a database table. Hibernate can then save those objects based on your property file in the database. The same object can then be used to load those objects back from the database in the future.

That's just a basic idea, although the order of those steps would probably need some tweaking. Is that what you were wondering? I have a feeling that there is some other problem that you anticipate having?
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cameron Wallace McKenzie wrote:Well, create an object, and populate that object based on the data in the property files. Then, map the object to a database table. Hibernate can then save those objects based on your property file in the database. The same object can then be used to load those objects back from the database in the future.

That's just a basic idea, although the order of those steps would probably need some tweaking. Is that what you were wondering? I have a feeling that there is some other problem that you anticipate having?


That's the solution I had come up with. I was just wondering if there was a better one. Instead of making a new object just composed of two string properties, I was wondering if there was a way to map a properties file or a string hashmap. Or something else a bit more elegant.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes easy and functional trumps elegance.

-Cameron
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic