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(