0

I have two domain classes (db tables) in my Grails project:

class Doctor {
String role;
String name;
String surname;
String address;
 ...


@NotNull
static belongsTo = [secUser:SecUser]
....
}



class SecUser {

transient springSecurityService

String username
String password
...

}

I would like to find all SecUser that have not a correspondent Doctor.

How can I do it?

FrancescoDS
  • 1,077
  • 4
  • 21
  • 55

1 Answers1

0

I think you need something like this:

SecUser.executeQuery(" FROM SecUser secUser WHERE NOT EXISTS (SELECT doctor.SecUser FROM Doctor doctor")
David Chavez
  • 617
  • 3
  • 17