Quantcast
Channel: Spring Community Forums - Grails
Viewing all articles
Browse latest Browse all 40

How to filter records based on foreign key value

$
0
0
Hi All,


I have two Domain Classes A and B. The relationship between these two table is :

Code:

class B {
        A a
        static belongsTo = [A]

        static mapping = {
                id column: "a_id"
        }
}

Now, I have the value of a_id is 15 and want to get the a_id(15) related records from Domain class B.

Can some one help me in this, how can I get the A's particular value related records from B table by using Domain classes.


Thanks,

Ravindar

Viewing all articles
Browse latest Browse all 40

Trending Articles