Search in sources :

Example 1 with CriteriaJoinWalker

use of org.hibernate.loader.criteria.CriteriaJoinWalker in project hibernate-orm by hibernate.

the class SubqueryExpression method toSqlString.

@Override
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
    final StringBuilder buf = new StringBuilder(toLeftSqlString(criteria, criteriaQuery));
    if (op != null) {
        buf.append(' ').append(op).append(' ');
    }
    if (quantifier != null) {
        buf.append(quantifier).append(' ');
    }
    final SessionFactoryImplementor factory = criteriaQuery.getFactory();
    final OuterJoinLoadable persister = (OuterJoinLoadable) factory.getMetamodel().entityPersister(criteriaImpl.getEntityOrClassName());
    createAndSetInnerQuery(criteriaQuery, factory);
    criteriaImpl.setSession(deriveRootSession(criteria));
    final CriteriaJoinWalker walker = new CriteriaJoinWalker(persister, innerQuery, factory, criteriaImpl, criteriaImpl.getEntityOrClassName(), criteriaImpl.getSession().getLoadQueryInfluencers(), innerQuery.getRootSQLALias());
    return buf.append('(').append(walker.getSQLString()).append(')').toString();
}
Also used : OuterJoinLoadable(org.hibernate.persister.entity.OuterJoinLoadable) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) CriteriaJoinWalker(org.hibernate.loader.criteria.CriteriaJoinWalker)

Aggregations

SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)1 CriteriaJoinWalker (org.hibernate.loader.criteria.CriteriaJoinWalker)1 OuterJoinLoadable (org.hibernate.persister.entity.OuterJoinLoadable)1