xain
xain

Reputation: 13839

Grails GORM question

I have two domain classes:

class A {
 String Name
 ...
}

class B {
 A request
 B response
 ...
}

How can I get a list of unique As that are present as "requests" in B ? I tried

def g = A.findAll("from A as e, B as r where e=r.request")

But I have problems extracting the resulting objects.

Thanks

Upvotes: 2

Views: 132

Answers (1)

Aaron Saunders
Aaron Saunders

Reputation: 33345

B.executeQuery( "select distinct b.request from B b" );

Upvotes: 4

Related Questions