AbstractEntityJoinWalkerpublic abstract class AbstractEntityJoinWalker extends JoinWalker Abstract walker for walkers which begin at an entity (criteria
queries and entity loaders). |
Fields Summary |
---|
private final org.hibernate.persister.entity.OuterJoinLoadable | persister | private String | alias |
Methods Summary |
---|
protected final java.lang.String | getAlias()
return alias;
| public abstract java.lang.String | getComment()
| protected final org.hibernate.persister.entity.Loadable | getPersister()
return persister;
| protected java.lang.String | getWhereFragment()
// here we do not bother with the discriminator.
return persister.whereJoinFragment(alias, true, true);
| protected final void | initAll(java.lang.String whereString, java.lang.String orderByString, org.hibernate.LockMode lockMode)
walkEntityTree( persister, getAlias() );
List allAssociations = new ArrayList();
allAssociations.addAll(associations);
allAssociations.add( new OuterJoinableAssociation(
persister.getEntityType(),
null,
null,
alias,
JoinFragment.LEFT_OUTER_JOIN,
getFactory(),
CollectionHelper.EMPTY_MAP
) );
initPersisters(allAssociations, lockMode);
initStatementString( whereString, orderByString, lockMode);
| protected final void | initProjection(java.lang.String projectionString, java.lang.String whereString, java.lang.String orderByString, java.lang.String groupByString, org.hibernate.LockMode lockMode)
walkEntityTree( persister, getAlias() );
persisters = new Loadable[0];
initStatementString(projectionString, whereString, orderByString, groupByString, lockMode);
| private void | initStatementString(java.lang.String condition, java.lang.String orderBy, org.hibernate.LockMode lockMode)
initStatementString(null, condition, orderBy, "", lockMode);
| private void | initStatementString(java.lang.String projection, java.lang.String condition, java.lang.String orderBy, java.lang.String groupBy, org.hibernate.LockMode lockMode)
final int joins = countEntityPersisters( associations );
suffixes = BasicLoader.generateSuffixes( joins + 1 );
JoinFragment ojf = mergeOuterJoins( associations );
Select select = new Select( getDialect() )
.setLockMode( lockMode )
.setSelectClause(
projection == null ?
persister.selectFragment( alias, suffixes[joins] ) + selectString( associations ) :
projection
)
.setFromClause(
getDialect().appendLockHint( lockMode, persister.fromTableFragment( alias ) ) +
persister.fromJoinFragment( alias, true, true )
)
.setWhereClause( condition )
.setOuterJoins(
ojf.toFromFragmentString(),
ojf.toWhereFragmentString() + getWhereFragment()
)
.setOrderByClause( orderBy( associations, orderBy ) )
.setGroupByClause( groupBy );
if ( getFactory().getSettings().isCommentsEnabled() ) {
select.setComment( getComment() );
}
sql = select.toStatementString();
| protected boolean | isJoinedFetchEnabled(org.hibernate.type.AssociationType type, org.hibernate.FetchMode config, org.hibernate.engine.CascadeStyle cascadeStyle)The superclass deliberately excludes collections
return isJoinedFetchEnabledInMapping(config, type);
| public java.lang.String | toString()
return getClass().getName() + '(" + getPersister().getEntityName() + ')";
|
|