I have try this one in many ways finally i found a way but it is not working on linux environment following HQL is that
SELECT es.eventId as eventId, MAX(es.raisedTimestamp) as raisedTimestamp, es.id as id, es.isReset as isReset FROM EsEvent es WHERE es.isReset=1 GROUP BY es.eventId ORDER BY es.raisedTimestamp DESC
this will end up with the enabled ONLY_FULL_GROUP_BY mode in mysql.
so that i added ANY_VALUE() function to my hql below one is that.
SELECT es.eventId as eventId, MAX(es.raisedTimestamp) as raisedTimestamp, ANY_VALUE(es.id) as id, es.isReset as isReset FROM EsEvent es WHERE es.isReset=1 GROUP BY es.eventId ORDER BY ANY_VALUE(es.raisedTimestamp) DESC
in this case it will end up with HQL exception like this
Failed to create sessionFactory object: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.internal.ast.tree.MethodNode +-[METHOD_CALL] MethodNode: '('| +-[METHOD_NAME] IdentNode: 'ANY_VALUE' {originalText=ANY_VALUE}| \-[EXPR_LIST] SqlNode: 'exprList'| \-[DOT] DotNode:'esevent0_.ID'{propertyName=id,dereferenceType=PRIMITIVE,getPropertyPath=id,path=es.id,tableAlias=esevent0_,className=org.reactor.monitoring.model.entity.EsEvent,classAlias=es}| +-[ALIAS_REF] IdentNode: 'esevent0_.ID' {alias=es, className=org.reactor.monitoring.model.entity.EsEvent, tableAlias=esevent0_} | \-[IDENT] IdentNode: 'id' {originalText=id}
please any one can help me to fix this out. it is really helpful and if you can give me reason behind this it's highly appreciate.