Quantcast

GORM or GSQL or Hibernate+POJO

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

GORM or GSQL or Hibernate+POJO

skadiy000
Deal All

In our group we do not access the Oracle DB tables directly as a standard. We perform all DB operations through stored procs that return a refcursor. So far we used Spring and Hibernate/iBATIS. We started using GROOVY and GRAILS to begin with for one of our corporate intranet  web application.

As far as the GROOVY and GRAILS is concerned, I need some expert advise before I spend a lot of time doing research, what is the best way to proceed?

Appreciate help.

Thanks in advance to all readers, experts and authors.



Srinivasa Kadiyala
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GORM or GSQL or Hibernate+POJO

Tom Nichols
I don't know how Hibernate/ GORM handles mapping when you're dealing
with sprocs.  I imagine it's hard since the whole point of Hibernate
is to map properties to columns.  In the case of your sprocs,  you are
restricting access to that.  You mentioned you are already using
Hibernate?  Keep in mind, however you're doing it now you can also do
it in Groovy; however when you start talking about Grails and the
additional layer of GORM's dynamic query-like abilities -- I'm not
sure how GORM will like not having direct access to the tables.

If you were just using Spring's JDBCTemplate and iBATIS, I would have
said you should use Groovy SQL, as it makes it extremely easy to deal
with result sets when using your own queries.

Someone with experience using Grails/GORM and custom mappings might
have more insight into that side of things.

-Tom



On Fri, Aug 21, 2009 at 10:53 AM, Srinivasa,
Kadiyala<[hidden email]> wrote:

>
> Deal All
>
> In our group we do not access the Oracle DB tables directly as a standard.
> We perform all DB operations through stored procs that return a refcursor.
> So far we used Spring and Hibernate/iBATIS. We started using GROOVY and
> GRAILS to begin with for one of our corporate intranet  web application.
>
> As far as the GROOVY and GRAILS is concerned, I need some expert advise
> before I spend a lot of time doing research, what is the best way to
> proceed?
>
> Appreciate help.
>
> Thanks in advance to all readers, experts and authors.
>
> :confused:
>
>
> --
> View this message in context: http://www.nabble.com/GORM-or-GSQL-or-Hibernate%2BPOJO-tp25081367p25081367.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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GORM or GSQL or Hibernate+POJO

bdrhoa
One thing you might run into with using POJO domain objects is that
not all the plugins work with them. I ran into that trying to use the
Spring Security Plugin, for example.
http://stackoverflow.com/questions/1203317/using-java-domain-objects-with-spring-security-plugin

Here's a useful article on the topic. Note that an existing database
is referred to as a legacy database.
http://www.ibm.com/developerworks/library/j-grails07158/index.html

On Fri, Aug 21, 2009 at 9:14 AM, Tom Nichols<[hidden email]> wrote:

> I don't know how Hibernate/ GORM handles mapping when you're dealing
> with sprocs.  I imagine it's hard since the whole point of Hibernate
> is to map properties to columns.  In the case of your sprocs,  you are
> restricting access to that.  You mentioned you are already using
> Hibernate?  Keep in mind, however you're doing it now you can also do
> it in Groovy; however when you start talking about Grails and the
> additional layer of GORM's dynamic query-like abilities -- I'm not
> sure how GORM will like not having direct access to the tables.
>
> If you were just using Spring's JDBCTemplate and iBATIS, I would have
> said you should use Groovy SQL, as it makes it extremely easy to deal
> with result sets when using your own queries.
>
> Someone with experience using Grails/GORM and custom mappings might
> have more insight into that side of things.
>
> -Tom
>
>
>
> On Fri, Aug 21, 2009 at 10:53 AM, Srinivasa,
> Kadiyala<[hidden email]> wrote:
>>
>> Deal All
>>
>> In our group we do not access the Oracle DB tables directly as a standard.
>> We perform all DB operations through stored procs that return a refcursor.
>> So far we used Spring and Hibernate/iBATIS. We started using GROOVY and
>> GRAILS to begin with for one of our corporate intranet  web application.
>>
>> As far as the GROOVY and GRAILS is concerned, I need some expert advise
>> before I spend a lot of time doing research, what is the best way to
>> proceed?
>>
>> Appreciate help.
>>
>> Thanks in advance to all readers, experts and authors.
>>
>> :confused:
>>
>>
>> --
>> View this message in context: http://www.nabble.com/GORM-or-GSQL-or-Hibernate%2BPOJO-tp25081367p25081367.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
>
>
>



--
---------------------------
www.maf.org/rhoads
www.ontherhoads.org

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GORM or GSQL or Hibernate+POJO

skadiy000
In reply to this post by Tom Nichols
Thanks Tom for the inputs.

As Tom said, looking for more inputs from someone with experience using Grails/GORM and custom mappings that might have more insight into that side of things.


**** Any more ???? *****

Thanks in advance


Tom Nichols wrote
I don't know how Hibernate/ GORM handles mapping when you're dealing
with sprocs.  I imagine it's hard since the whole point of Hibernate
is to map properties to columns.  In the case of your sprocs,  you are
restricting access to that.  You mentioned you are already using
Hibernate?  Keep in mind, however you're doing it now you can also do
it in Groovy; however when you start talking about Grails and the
additional layer of GORM's dynamic query-like abilities -- I'm not
sure how GORM will like not having direct access to the tables.

If you were just using Spring's JDBCTemplate and iBATIS, I would have
said you should use Groovy SQL, as it makes it extremely easy to deal
with result sets when using your own queries.

Someone with experience using Grails/GORM and custom mappings might
have more insight into that side of things.

-Tom



On Fri, Aug 21, 2009 at 10:53 AM, Srinivasa,
Kadiyala<srinivasa_kadiyala@cable.comcast.com> wrote:
>
> Deal All
>
> In our group we do not access the Oracle DB tables directly as a standard.
> We perform all DB operations through stored procs that return a refcursor.
> So far we used Spring and Hibernate/iBATIS. We started using GROOVY and
> GRAILS to begin with for one of our corporate intranet  web application.
>
> As far as the GROOVY and GRAILS is concerned, I need some expert advise
> before I spend a lot of time doing research, what is the best way to
> proceed?
>
> Appreciate help.
>
> Thanks in advance to all readers, experts and authors.
>
> :confused:
>
>
> --
> View this message in context: http://www.nabble.com/GORM-or-GSQL-or-Hibernate%2BPOJO-tp25081367p25081367.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

Srinivasa Kadiyala
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GORM or GSQL or Hibernate+POJO

Robert Fischer
In reply to this post by bdrhoa
You could use the extended GORM mappings plugin.  This is going to involve a fair amount of
bookkeeping, but if you were doing JDBCTemplate and iBATIS before, you're used to that.

~~ Robert.

Brad Rhoads wrote:

> One thing you might run into with using POJO domain objects is that
> not all the plugins work with them. I ran into that trying to use the
> Spring Security Plugin, for example.
> http://stackoverflow.com/questions/1203317/using-java-domain-objects-with-spring-security-plugin
>
> Here's a useful article on the topic. Note that an existing database
> is referred to as a legacy database.
> http://www.ibm.com/developerworks/library/j-grails07158/index.html
>
> On Fri, Aug 21, 2009 at 9:14 AM, Tom Nichols<[hidden email]> wrote:
>> I don't know how Hibernate/ GORM handles mapping when you're dealing
>> with sprocs.  I imagine it's hard since the whole point of Hibernate
>> is to map properties to columns.  In the case of your sprocs,  you are
>> restricting access to that.  You mentioned you are already using
>> Hibernate?  Keep in mind, however you're doing it now you can also do
>> it in Groovy; however when you start talking about Grails and the
>> additional layer of GORM's dynamic query-like abilities -- I'm not
>> sure how GORM will like not having direct access to the tables.
>>
>> If you were just using Spring's JDBCTemplate and iBATIS, I would have
>> said you should use Groovy SQL, as it makes it extremely easy to deal
>> with result sets when using your own queries.
>>
>> Someone with experience using Grails/GORM and custom mappings might
>> have more insight into that side of things.
>>
>> -Tom
>>
>>
>>
>> On Fri, Aug 21, 2009 at 10:53 AM, Srinivasa,
>> Kadiyala<[hidden email]> wrote:
>>> Deal All
>>>
>>> In our group we do not access the Oracle DB tables directly as a standard.
>>> We perform all DB operations through stored procs that return a refcursor.
>>> So far we used Spring and Hibernate/iBATIS. We started using GROOVY and
>>> GRAILS to begin with for one of our corporate intranet  web application.
>>>
>>> As far as the GROOVY and GRAILS is concerned, I need some expert advise
>>> before I spend a lot of time doing research, what is the best way to
>>> proceed?
>>>
>>> Appreciate help.
>>>
>>> Thanks in advance to all readers, experts and authors.
>>>
>>> :confused:
>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/GORM-or-GSQL-or-Hibernate%2BPOJO-tp25081367p25081367.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
>>
>>
>>
>
>
>

--
~~ Robert Fischer, Smokejumper IT Consulting.
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/gormbook

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GORM or GSQL or Hibernate+POJO

skadiy000
Hi Robert

Thanks for the nice tip.

I want a bit more clarification as you are expert in GORM and GSQL.

I have the following mapping in my hibernate mapping file..say abc.hbm.xml

******code ************
<sql-query name="menuSummaryReport_SP" callable="true">
                <return alias="menuSummaryReport" class="MenuSummaryReport">
                </return>
                {call
                MENU_REPORTS.menu_summary_report(?,:p_mt_asset_id,:p_start_date,:p_end_date)}
        </sql-query>

******** end ************

I call the hbm file in my service class like the following:

*********service class code ********

List<MenuSummaryReport> menuSummaryReportList = (List<MenuSummaryReport>) menuSummaryReportDao
                                .executeMmsStoredProc("menuSummaryReport_SP", paramsMap);

*********** end ***************

Shall I need to create a service and write code similar to the POJOs I had written??

How can I make a call to the HBL  named query in GRAILS? Where I need to exactly do this??

Appreciate your inputs.

Thanks again for a quick response.

Srini
Robert Fischer wrote
You could use the extended GORM mappings plugin.  This is going to involve a fair amount of
bookkeeping, but if you were doing JDBCTemplate and iBATIS before, you're used to that.

~~ Robert.

Brad Rhoads wrote:
> One thing you might run into with using POJO domain objects is that
> not all the plugins work with them. I ran into that trying to use the
> Spring Security Plugin, for example.
> http://stackoverflow.com/questions/1203317/using-java-domain-objects-with-spring-security-plugin
>
> Here's a useful article on the topic. Note that an existing database
> is referred to as a legacy database.
> http://www.ibm.com/developerworks/library/j-grails07158/index.html
>
> On Fri, Aug 21, 2009 at 9:14 AM, Tom Nichols<tmnichols@gmail.com> wrote:
>> I don't know how Hibernate/ GORM handles mapping when you're dealing
>> with sprocs.  I imagine it's hard since the whole point of Hibernate
>> is to map properties to columns.  In the case of your sprocs,  you are
>> restricting access to that.  You mentioned you are already using
>> Hibernate?  Keep in mind, however you're doing it now you can also do
>> it in Groovy; however when you start talking about Grails and the
>> additional layer of GORM's dynamic query-like abilities -- I'm not
>> sure how GORM will like not having direct access to the tables.
>>
>> If you were just using Spring's JDBCTemplate and iBATIS, I would have
>> said you should use Groovy SQL, as it makes it extremely easy to deal
>> with result sets when using your own queries.
>>
>> Someone with experience using Grails/GORM and custom mappings might
>> have more insight into that side of things.
>>
>> -Tom
>>
>>
>>
>> On Fri, Aug 21, 2009 at 10:53 AM, Srinivasa,
>> Kadiyala<srinivasa_kadiyala@cable.comcast.com> wrote:
>>> Deal All
>>>
>>> In our group we do not access the Oracle DB tables directly as a standard.
>>> We perform all DB operations through stored procs that return a refcursor.
>>> So far we used Spring and Hibernate/iBATIS. We started using GROOVY and
>>> GRAILS to begin with for one of our corporate intranet  web application.
>>>
>>> As far as the GROOVY and GRAILS is concerned, I need some expert advise
>>> before I spend a lot of time doing research, what is the best way to
>>> proceed?
>>>
>>> Appreciate help.
>>>
>>> Thanks in advance to all readers, experts and authors.
>>>
>>> :confused:
>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/GORM-or-GSQL-or-Hibernate%2BPOJO-tp25081367p25081367.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
>>
>>
>>
>
>
>

--
~~ Robert Fischer, Smokejumper IT Consulting.
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/gormbook

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

    http://xircles.codehaus.org/manage_email

Srinivasa Kadiyala
Loading...