Hi !
I'm trying to group my results by month, but according to the standard error monitor it's not coded the way it should be. Do you know what's the origin of the error ?
Here's the request (I get no error before adding the lines after the comment saying "mois") :
Code:
session = HibernateUtil.currentSession();
@SuppressWarnings("unchecked")
Criteria consoLoc = session
.createCriteria(Circulation.class)
.createAlias(PROP_NUM_LOC, "loc")
//conditions
.add(Expression.isNotNull(PROP_TONNAGE))
.add(Expression.sql("Conso_elec > (0.005*tonnage)*km"))
.add(Expression.sql("Conso_elec < (8 + 0.019*tonnage)*km"))
.setProjection(
Projections
.projectionList()
.add(proj_somme_elec)
.add(proj_somme_km)
.add(proj_somme_tkbrc)
.add(proj_tonnage_moyen)
// mois
.add(Projections.sqlGroupProjection(
"month(DhDeparttrain) as month",
"month(DhDeparttrain)",
new String[]{"month"},
new Type[] {Hibernate.DOUBLE})));