• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populating internal data using hibernate

 
Bhavin Sanghani
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Anybody knows how to populate application's internal data using hibernate? So, whenever database is created I dont need to execute script to populate the data.

Thanks,
Bhavin
 
Ramesh Srinivasan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bhavin Sanghani:
Hi,

Anybody knows how to populate application's internal data using hibernate? So, whenever database is created I dont need to execute script to populate the data.

Thanks,
Bhavin


During application start-up you want to insert record, right?

When you are creating Hibernate Session Factory you build your objects such way that you could populate your data with out running script.
 
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
I guess my question would be, 'where is the data coming from?' Is it in another database, or is it on the file system, or is it in serialized objects. You'll have to create some sort of a script, even if it's just a Java 'script' that creates entities based on your existing data, and does Hibernate add/create calls.

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