On September 30, 2016 at 3:49:43 PM, Jeff Brown (
bro...@ociweb.com) wrote:
>
>
> On September 29, 2016 at 5:17:11 PM, GrailsNewbie (
prasha...@gmail.com) wrote:
> > Hello,
> >
> > If my grails service class returns a result set of type cursor (multiple
> > rows) can I map them to domain? in other words can I use domain as model to
> > map a row set . For example if I have a Person table with columns Id, First
> > Name, Last Name, Address etc. and my result set returns me rows with only
> > columns FirstName and LastName . Can I create a domain called Person and
> > not map it directly to table Person instead use it a plain model?
> >
>
> You can’t create a domain lass and not map it to a table. Part of the definition of a domain
> class is that it is mapped to a table (assuming you are using Hibernate GORM).
>
> You could create a class that isn’t a domain class and use that for what you are describing.
> You should define that class under src/groovy/ for Grails 2 or src/main/groovy for Grails
> 3.
>
>
Strictly speaking that isn’t really true. You could use…