Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Grails ORM Join
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sudhakar Vaddi  
View profile  
 More options Jun 18 2010, 3:44 am
From: Sudhakar Vaddi <vaddi.sudha...@googlemail.com>
Date: Fri, 18 Jun 2010 13:14:32 +0530
Local: Fri, Jun 18 2010 3:44 am
Subject: Grails ORM Join

Hi,

I have two domain objects Person and Address.
Person hasmany addresses.

I need join these two using Criteria Builder. Below is the SQL :

select * from Person p, Address a where p.address_id = a.id and p.id=?

How to convert this into Criteria in Grails?

Appreciate your help.

Thanks
Sudhakar


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
uday  
View profile  
 More options Jun 18 2010, 5:14 am
From: uday <meudaypra...@gmail.com>
Date: Fri, 18 Jun 2010 02:14:28 -0700 (PDT)
Local: Fri, Jun 18 2010 5:14 am
Subject: Re: Grails ORM Join
These blogs may help you

http://www.intelligrape.com/blog/2010/06/14/grails-createcriteria-que...
http://adhockery.blogspot.com/2009/06/querying-by-association-redux.html

On Jun 18, 12:44 pm, Sudhakar Vaddi <vaddi.sudha...@googlemail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
karthi  
View profile  
 More options Jun 21 2010, 10:40 am
From: karthi <karthi4...@gmail.com>
Date: Mon, 21 Jun 2010 20:10:44 +0530
Local: Mon, Jun 21 2010 10:40 am
Subject: Re: [IGGUG:224] Re: Grails ORM Join

If you want to query person for given address.id, the following is the code

Person.createCriteria().list{
       address{
              eq("id",some_address_id)
        }

}

else if you want all person with corresponding addresss

Person.list()

the above should suffice, its object orientation.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »