Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.2-RC1
-
Component/s: Persistence
-
Labels:None
Description
According to the docs here: http://grails.codehaus.org/Hibernate+Criteria+Builder we are supposed to be able to use sqlProjection() to add an arbitrary SQL-based projection as specifed here: http://www.hibernate.org/hib_docs/v3/api/org/hibernate/criterion/Projections.html
This doesn't seem to be implemented.
I am trying a work around using this method:
def myThings = Thing.createCriteria().list() {
projections {
property("id")
sqlProjection("count(*) as rel",
["rel"] as String[],
[Hibernate.INTEGER] as Type[])
}
}
but to no avail. I get the following error:
Caused by: groovy.lang.MissingMethodException: No signature of method: grails.orm.HibernateCriteriaBuilder.sqlProjection() is applicable for argument types: (java.lang.String, [Ljava.lang.String;, [Lorg.hibernate.type.Type;) values: {"count(*) as rel", ["rel"], [org.hibernate.type.IntegerType@30571b]}
Any idea when it will be possible to add such Projections?
Issue Links
- relates to
-
GRAILS-9402
sqlProjection is not supported
-
duplicates
GRAILS-5431