hibernate subquery throwing Null Pointer Exception
The issue was resoled by adding projection to inner query.
commCriteria.createAlias("A1.b", "b1");commCriteria.setProjection(Projections.projectionList().add(Projections.property("b1.c")));
It is a bug in Hibernate https://hibernate.atlassian.net/browse/HHH-993
As @Renjith said, it is solved by adding a projection to the DetachedCriteria.