Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Data row initialization for DataBase Table
Data row initialization for DataBase Table [message #390594] Mon, 27 July 2009 09:29 Go to next message
Enrico is currently offline EnricoFriend
Messages: 82
Registered: July 2009
Hi all,

in my persistence.xml I set:

<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database"/>

in order to let eclipelink generate the DataBase schema when my
application start-up.
I would like to know if there is (or what is) an easy-way to insert on
tables, initial rows. I would like for example that in my "department"
table (related to my Department entity class), i have the possibility to
have a certain number of "pre-loaded" rows.

I can manage that using my db scripts, but I would like to know if some
eclipselink configuration can be usefult to get the same goal.

Re: Data row initialization for DataBase Table [message #390596 is a reply to message #390594] Mon, 27 July 2009 15:21 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You could use a SessionCustomizer to populate the data (you will need to
login in the customizer). But it may be better to have some preload
process in your app, or ant build file.

James : Wiki : Book : Blog : Twitter
Previous Topic:Exception when using EclipseLink JPA in OC4J
Next Topic:Negative Ids
Goto Forum:

Current Time: Fri Apr 10 01:11:53 GMT 2020

Powered by FUDForum. Page generated in 0.02008 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top