protected abstract String toLeftSqlString(Criteria criteria, CriteriaQuery outerQuery);
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
final SessionFactoryImplementor factory = criteriaQuery.getFactory();
final OuterJoinLoadable persister =
( OuterJoinLoadable ) factory.getEntityPersister( criteriaImpl.getEntityOrClassName() );
createAndSetInnerQuery( criteriaQuery, factory );
criteriaImpl.setSession( deriveRootSession( criteria ) );