Given I have this domain:
class Game {
Set<GameType> gameType
String name
}
And this enum:
enum Gametype {
RHYTHM, ADVENTURE, PUZZLE, RPG, HORROR, FIGHTING, MOBA, MMO
}
I need to retrieve a list of games that contains at least one of the game types indicated in the query. I tried using this code:
def retrieveGamesThatMayBeUnderGameTypes( List<GameType> listOfGameTypes) {
return Game.createCriteria().list(){
'in'("gameType", listOfGameTypes)
}
}
However, it returns a NullPointerException. Any ideas?