How do you create this sort of query in SQL / Hibernate / GORM? -



How do you create this sort of query in SQL / Hibernate / GORM? -

an initial implementation in gorm like

def stuff = table.find { active = true }

say store different "revisions" , 1 revision can active @ time.

the problem when create new table not active. want active one, or recent 1 if none active.

how create query says like: each type of table (select distinct someid shared between revisions), me active revision, or, if there isn't one, me created.

is problem beyond gorm's capabilities? should read on?

this won't homecoming result single query, believe meet requirements:

def stuff = table.findbyactive(true) ?: table.first()

sql hibernate grails gorm

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -