* @see org.hibernate.persister.entity.Joinable#fromJoinFragment(java.lang.String, boolean, boolean)
*/
protected void applyRootReturnTableFragments(SelectStatementBuilder select) {
final String fromTableFragment;
final String rootAlias = entityReferenceAliases.getTableAlias();
final OuterJoinLoadable outerJoinLoadable = (OuterJoinLoadable) getRootEntityReturn().getEntityPersister();
if ( getQueryBuildingParameters().getLockOptions() != null ) {
fromTableFragment = getSessionFactory().getDialect().appendLockHint(
getQueryBuildingParameters().getLockOptions(),
outerJoinLoadable.fromTableFragment( rootAlias )
);
select.setLockOptions( getQueryBuildingParameters().getLockOptions() );
}
else if ( getQueryBuildingParameters().getLockMode() != null ) {
fromTableFragment = getSessionFactory().getDialect().appendLockHint(
getQueryBuildingParameters().getLockMode(),
outerJoinLoadable.fromTableFragment( rootAlias )
);
select.setLockMode( getQueryBuildingParameters().getLockMode() );
}
else {
fromTableFragment = outerJoinLoadable.fromTableFragment( rootAlias );
}
select.appendFromClauseFragment( fromTableFragment + outerJoinLoadable.fromJoinFragment( rootAlias, true, true ) );
}