-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to get the static data on start of application server
PostPosted: Fri Sep 15, 2006 9:39 am 
Newbie

Joined: Fri Sep 15, 2006 9:25 am
Posts: 3
Location: India
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:hibernate2

Name and version of the database you are using:Oracle

I am using hibernate in a web based application. I am using jboss3.2.5 web server.
I have a table with 5 columns. The data in the table is not going to change. it is a static data. So I want to get the data only once when the server starts. Enumeration is one solution but I cannot use it since I need the values from all the 5 columns and enumeration provides only 2 id and description.

Can anyone please help in solving this problem.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 3:42 pm 
Beginner
Beginner

Joined: Wed Jun 21, 2006 10:08 am
Posts: 26
Hibernate's Second Level Cache.

It will retrieve it once from the DB, and every time after that from the cache.

Read Chapter 19 of the docs.

_________________
- Jonathan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 4:00 pm 
Beginner
Beginner

Joined: Tue Oct 18, 2005 3:44 am
Posts: 27
if you create your database from hibernate you can use
<database-source>
<create>
INSERT INTO ....
</create>
<drop>
</drop>
</database-source>

into your <hibernate-mapping> tag, after of the <class> tag.

Another solution is to use a file named import.sql, with your inserts. This file must be on the classpath, and it will be loaded at the moment of the deploy.

Cathy


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