Lev wrote:
>> 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.

Actually this happens whenever you initialize hibernate's session
manager. Of course that's usually the case when you deploy your app.
> 
> 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

It is possible? Sometimes it happens, sometimes not?
Could you echo all your queries and check whether they are ok?
<property name="show_sql">true</property>

"Could not execute query" is unfortunately not very descriptive. But try
to check whether this is a table recreation error by dropping all
tables, removing the auto create option and check whether the error
message changes. (I expect that it does to something more descriptive
like "table xy does not exist".
> 
> thank you for your help.

Thomas

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