grails - Sorting on nullable fields in GORM -
i'm trying figure out how sort on multiple fields in grails 3, 1 of may or may not null. have book domain:
class book { string title string sorttitle static constraints = { title blank: false sorttitle nullable: true } }
books titles "the peripheral" have sorttitle
of "peripheral, the", otherwise sorttitle
null. want books sorted sorttitle
if 1 exists, otherwise title
.
i found other similar questions, none nullable field. happen have pointers in right direction?
Comments
Post a Comment