I have three tables here.The user is able to apply the training available.when he/she selects the training then it is placed at TRAINUSER table according to his/her userID. I wa
Some of this will depend on what your domain classes look like, you could use executeQuery like so:
Training.executeQuery( "from Training tr where tr.id not in ( select t.id from TrainUser tu join tu.training t join tu.user u where u.username = :uname )", [uname: 'ADMIN'] )
Assuming the following domains, only relevant fields included:
class User {
String username
}
class TrainUser {
static hasMany = [training: Training, user: User]
}
class Training {
String name
}