Result set mapping in Grails / GORM

Posted by armandino on Stack Overflow See other posts from Stack Overflow or by armandino
Published on 2010-03-12T08:09:48Z Indexed on 2010/03/12 8:17 UTC
Read the original article Hit count: 403

Filed under:
|
|
|
|

I want to map the result of a native SQL query to a simple bean in grails, similar to what the @SqlResultSetMapping annotation does.

For example, given a query

select x.foo, y.bar, z.baz from //etc...

map the result to

class FooBarBaz {
  String foo
  String bar
  String baz
}

Can anyone provide an example of how to do this in grails? Thanks in advance.

© Stack Overflow or respective owner

Related posts about groovy

Related posts about grails