>
> > Ah, the examples I have been looking at are JBoss
> Seam
> > examples and are based off of Hibernate as the
> persistence
> > provider. Hibernate has a property that if enabled
> will do
> > this for you.
> >
> > <property name="hibernate.hbm2ddl.auto"
> value="create-drop"/>
> >
> > When this property is set I guess it peforms the
> sql script
> > execution. Since I have always been using TopLink
> it never
> > worked. Is it is easy to replace TopLink with
> Hibernate since
> > I would like this feature.
>
> That property just acts like Toplink in terms of
> creating (and dropping
> first, so its really only a dev-env property with the
> 'create-drop'
> value, there's an 'update' one which updates the
> schema etc) tables
> based on the entities you've defined, not running any
> data-loading
> script you might have floating around.
>
> If none of the other suggestions are appropriate (and
> I thought creating
> the data as part of the script to deploy the
> application was), maybe a
> web context listener that checks a field in a control
> table and runs a
> script if the value hasn't been set to true (which'd
> happen at the end
> of the script/s).
>
> Cheers
> Joe
>
> This message contains information that may be
> privileged or confidential and is the property of the
> Capgemini Group. It is intended only for the person
> to whom it is addressed. If you are not the intended
> recipient, you are not authorized to read, print,
> retain, copy, disseminate, distribute, or use this
> message or any part thereof. If you receive this
> message in error, please notify the sender
> immediately and delete all copies of this message.
> ------------------------------------------------------
> ---------------
> To unsubscribe, e-mail:
> users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail:
> users-help_at_glassfish.dev.java.net
I was asking about this on the JBoss Seam forum and one of the JBoss people responded with a import.sql script will be executed if this property is specified in the persistence.xml
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067661#4067661
[Message sent by forum member 'samdoyle' (samdoyle)]
http://forums.java.net/jive/thread.jspa?messageID=228267