While listing some data from DB where we are getting below error. When i debug LoadQueryInfluencer parameter which i have created the object from the session.getLoadQueryInfluencer(). where from application log i can able to see the object is loaded where as in hibernate stacktrace in hibernate its giving null. Below is the logs and snippet of the issue. Please help me out. ~String[] implementors = factory.getImplementors(criteriaImplValue.getEntityOrClassName()); LOG.info(":::::Entity Names 'Implementors' array string length:::::"+implementors.length); if(getLoadQueryInflncr() ==null) { setLoadQueryInflncr(((SessionImpl)factory.getCurrentSession()).getLoadQueryInfluencers()); LOG.info(":::::LoadQueryInfluencer object created using factory.getLoadQueryInfluencers() method:::::"); } else { setLoadQueryInflncr(new LoadQueryInfluencers(factory)); LOG.info(":::::LoadQueryInfluencer object created using constructor:::::"); } LOG.info("Entity Name"+ factory .getEntityPersister(implementors[0]) "SessionImplementorFactory"+factory"Criteria Impl Value"criteriaImplValue "Entity Root Name"implementors[0]"Load Query influencer"+loadQueryInflncr.toString()); for(int i=0; i< implementors.length; i++) { loader[i] = new CriteriaLoader((OuterJoinLoadable) factory .getEntityPersister(implementors[i]), factory, criteriaImplValue, implementors[i], getLoadQueryInflncr()/*new LoadQueryInfluencers() no filters */); } ~ java.lang.NullPointerException at org.hibernate.criterion.SubqueryExpression.toSqlString(SubqueryExpression.java:83) at org.hibernate.criterion.LogicalExpression.toSqlString(LogicalExpression.java:62) at org.hibernate.criterion.Junction.toSqlString(Junction.java:82) at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:380) at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:102) at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:82) at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:92) +org.hibernate.criterion.SubqueryExpression+ System.out.println(":::::Entering hibernate Sub Query Expression :::::::: "); System.out.println(":::::Criteria :::::::: " + criteria + ":::::Crtier Query :::::::" + criteriaQuery); SessionFactoryImplementor factory = criteriaQuery.getFactory(); System.out.println(":::::SessionImplelmentor Factory :::::::: " + factory); OuterJoinLoadable persister = (OuterJoinLoadable)factory.getEntityPersister(this.criteriaImpl.getEntityOrClassName()); System.out.println(":::::Session from CriteriaImpl :::::::: " + persister.getEntityName()); createAndSetInnerQuery(criteriaQuery, factory); this.criteriaImpl.setSession(deriveRootSession(criteria)); System.out.println(":::::Innerquery :::::::: " + this.innerQuery.getRootCriteria().getEntityOrClassName()); System.out.println(":::::criteriaImpl getEntityOrClassName :::::::: " + this.criteriaImpl.getEntityOrClassName()); System.out.println(":::::criteriaImpl getSession().getLoadQueryInfluencers() :::::::: " + this.criteriaImpl.getSession().getLoadQueryInfluencers().getClass().getName()); System.out.println(":::::innerQuery.getRootSQLALias() :::::::: " + this.innerQuery.getRootSQLALias()); |