I have this domain :
class Participation {
ParticipationStatus status
}
class ParticipationStatus{
String name
Date creationDate
}
I create a query :
Participation.createCriteria().list{
createAlias("status","statusAlias")
order "statusAlias.creationDate"
projections{
groupProperty "id"
}
}
But I received an error : Caused by: java.sql.SQLException: ORA-00979: N'est pas une expression GROUP BY
I 'm working 2 days ago on this query grrrr ! ;-)
Thanks a lot
Every field you use in aggregate queries (the one using projections
) should be either a groupProperty
, or only an aggregate function argument (that is, in projections
anyway).
In this example, try
Participation.createCriteria().list{
createAlias("status","statusAlias")
order "statusAlias.creationDate"
projections{
groupProperty "id"
groupProperty "statusAlias.creationDate"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With