Problem with GORM not creating tables for hbm mapped entities

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with GORM not creating tables for hbm mapped entities

Marc Palmer Local
Hi,

I really don't get this, it seems bizarre.

We have some hibernate entities mapped in a hbm.xml file (for distributed Quartz usage).

This map fine and create fine in the DB, alongside our regular GORM classes - but not if dbCreate is "update"!?

It creates them fine if the dbCreate mode is "create-drop".

Whatever the mode our GORM classes are created fine.

This is easily proven if I turn on the hbm2ddl logging - I see all the CREATE TABLE statements for the qrtz_xxx tables only if the mode is create-drop.

It makes no sense!?!

Thanks for any input...

Marc
~ ~ ~
Marc Palmer
Blog         > http://www.anyware.co.uk
Twitter      > http://twitter.com/wangjammer5
Grails Rocks > http://www.grailsrocks.com







---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with GORM not creating tables for hbm mapped entities

Marc Palmer Local

On 21 Jun 2010, at 22:05, Marc Palmer wrote:

> Hi,
>
> I really don't get this, it seems bizarre.
>
> We have some hibernate entities mapped in a hbm.xml file (for distributed Quartz usage).
>
> This map fine and create fine in the DB, alongside our regular GORM classes - but not if dbCreate is "update"!?
>
> It creates them fine if the dbCreate mode is "create-drop".
>
> Whatever the mode our GORM classes are created fine.
>
> This is easily proven if I turn on the hbm2ddl logging - I see all the CREATE TABLE statements for the qrtz_xxx tables only if the mode is create-drop.
>
> It makes no sense!?!

FYI Burt Beckwith kindly helped me out with this. Basically the  hibernate mappings for Quartz include custom SQL statements to create/update tables etc. The problem is that hibernate does not apply these in "update" mode, only in "create-xxx" modes.

Apart from being a pile of suck (I mean, why not have hooks in config for update vs create SQL statements so users can apply smart behaviour), at least I now understand the problem and must hand-craft and SQL statement to execute on the server before our app starts up the first time.

Marc



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email