Skip to content

Instantly share code, notes, and snippets.

@mlist
Created December 13, 2013 12:32
Show Gist options
  • Save mlist/7943590 to your computer and use it in GitHub Desktop.
Save mlist/7943590 to your computer and use it in GitHub Desktop.
grails projections with alias and left outer join
def criteria = Spot.createCriteria()
def result = criteria.list {
eq("slide.id", params.long("id"))
createAlias('layoutSpot', 'lSpot', CriteriaSpecification.LEFT_JOIN)
createAlias('lSpot.sample', 'smpl', CriteriaSpecification.LEFT_JOIN)
projections {
property "id"
property "signal"
property "block"
property "row"
property "col"
property "smpl.name"
property "smpl.type"
property "smpl.target"
}
order('block', 'asc')
order('row', 'desc')
order('col', 'asc')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment