On 13-07-2010 at 12:01, Thomas Menke wrote:
> On 07/13/2010 08:22 AM, Lev wrote:
> > would anybody happen to know how to recreate (drop, then
> > create) a database with stripersist?
> >
> > further, do you know how to drop/create a specific table
> > within a database?
> >
> > i'm using hibernate with stripersist.
> 
> Do you want to change the structure of the table at runtime? If you do 
> not want to change the structure you could use a simple truncate query.
> 
> I use this property in my persistance.xml to update tables when I deploy 
> my application:
> 
> <!-- e.g. validate | update | create | create-drop -->
> <property name="hibernate.hbm2ddl.auto" value="update" />

And in addition to this, if Hibernate creates your database (e.g. when you
set the property to create or create-drop), it'll try to read the file
"import.sql" from the root of your classpath. If the file exists, Hibernate
executes the SQL statements after creating your database. You can use this to
insert initial data.

Personally, I use this with a HSQLDB in-memory database to test my code.


Oscar

-- 
   ,-_  Oscar Westra van Holthe - Kind      http://www.xs4all.nl/~kindop/
  /() )
 (__ (  The haves and the have-nots can often be traced back to the
=/  ()  dids and the did-nots.

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to