I am getting error
aliases expected length is 1; actual length is 4 at org.hibernate.transform.CacheableResultTransformer.transformTuple
I
In your case, EHCache can only be used with JPQL queries. That will also mean you will have to rewrite your query not to use sub-selects, unions or similar native sql constructions.