> There is no limitation that I can see.
>
> The reason one drops a table is because its table structure has changed.
> And if its structure has changed and you are using JPA annotations then
> you need to recompile your changed classes anyways and restart your
> application - which coupled with the "update" or "create" hibernate
> option recreates your table as per your compiled classes on restart.
>
> If the table structure has not changed then use "delete from
> <sometable>" to clear out the data.
>
> What's the issue / limitation? Are you dynamically constructing classes
> or something?
>
> --Nikolaos

hi,

i'm using <property name="hibernate.hbm2ddl.auto" value="create-drop"/>.

from my understanding (and playing around with small examples),
the tables are dropped and re-created at the beginning of the
deployment.

however, it appears that that the table(s) must exist in the DB prior
to deployment. if not, it is possible that the following exception will
occur:

javax.persistence.PersistenceException:
org.hibernate.exception.SQLGrammarException: could not execute query

this exception occurs when the table in question does not exist
prior to deployment AND i attempt to dao.read() entries from the
table.

however, if i first execute a dao.save(object) prior to the dao.read(),
it appears that the table is created without a problem.

i would have thought that the table creation would occur automagically.
is there a way for me to trigger the table creation without a
dao.save(obj) call?

thank you for your help.

------------------------------------------------------------------------------
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