Quantcast

GORM mapping vs custom hibernate mapping

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

GORM mapping vs custom hibernate mapping

Sami
I am using Grails 2.0.4 for my first app ever.

I want to map some – auxiliary – objects to DB table views.  Thus, I would like to use GORM for mapping the majority of my domain objects – all my core objects – and custom hibernate mapping for the rest.  

Currently, GORM has auto generated the DB schema for all my classes.  I will move the classes that dependent on the custom mapping to the sec/groovy folder.

Is it possible to mix domain modeling with GORM and custom hibernate mapping?

Are GORM generated domain objects and hibernate mapped objects functionally equivalent?  For example, will I be able to use Grails features such as dynamic finders on the hibernate mapped objects?

Thanks in advance for the help,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GORM mapping vs custom hibernate mapping

Jonathan Rosenberg
I am far from a Grails expert & I have only used 1.3.7, but here's
what I know about mixed GORM/Hibernate usage:

It is certainly possible to mix the two.  However:

1) A Hibernate-mapped class can only reference other Hibernate-mapped
classes from its mapping (seems obvious, but ...).
2) You will not get any of the GORM magic with thye Hibernate classes.
3) Any specific class will either use GORM or Hibenrate mappings.  You
can't mix the two.  Grails criteria, however, will work in either
case.

Hope this helps.

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/


On Wed, Jun 27, 2012 at 10:00 PM, Sami <[hidden email]> wrote:

> I am using Grails 2.0.4 for my first app ever.
>
> I want to map some – auxiliary – objects to DB table views.  Thus, I would
> like to use GORM for mapping the majority of my domain objects – all my core
> objects – and custom hibernate mapping for the rest.
>
> Currently, GORM has auto generated the DB schema for all my classes.  I will
> move the classes that dependent on the custom mapping to the sec/groovy
> folder.
>
> Is it possible to mix domain modeling with GORM and custom hibernate
> mapping?
>
> Are GORM generated domain objects and hibernate mapped objects functionally
> equivalent?  For example, will I be able to use Grails features such as
> dynamic finders on the hibernate mapped objects?
>
> Thanks in advance for the help,
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/GORM-mapping-vs-custom-hibernate-mapping-tp4630753.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

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

    http://xircles.codehaus.org/manage_email


Loading...