@Override protected boolean isDuplicateAssociation(final String foreignKeyTable, final String[] foreignKeyColumns) { //disable a join back to this same association final boolean isSameJoin = persister.getTableName().equals( foreignKeyTable ) && Arrays.equals( foreignKeyColumns, persister.getKeyColumnNames() ); return isSameJoin || super.isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * Should we join this association? */ protected boolean isJoinable( final JoinType joinType, final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type, final int depth) { if ( joinType == JoinType.NONE ) { return false; } if ( joinType == JoinType.INNER_JOIN ) { return true; } Integer maxFetchDepth = getFactory().getSessionFactoryOptions().getMaximumFetchDepth(); final boolean tooDeep = maxFetchDepth != null && depth >= maxFetchDepth; return !tooDeep && !isDuplicateAssociation( lhsTable, lhsColumnNames, type ); }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation( final String lhsTable, final String[] lhsColumnNames, final AssociationType type) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection() == ForeignKeyDirection.FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation( foreignKeyTable, foreignKeyColumns ); }
return JoinType.NONE; if ( isDuplicateAssociation( lhsTable, lhsColumns, associationType ) ) { return JoinType.NONE;
@Override protected boolean isDuplicateAssociation( final String foreignKeyTable, final String[] foreignKeyColumns ) { //disable a join back to this same association final boolean isSameJoin = persister.getTableName().equals( foreignKeyTable ) && Arrays.equals( foreignKeyColumns, persister.getKeyColumnNames() ); return isSameJoin || super.isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
@Override protected boolean isDuplicateAssociation( final String foreignKeyTable, final String[] foreignKeyColumns ) { //disable a join back to this same association final boolean isSameJoin = persister.getTableName().equals( foreignKeyTable ) && Arrays.equals( foreignKeyColumns, persister.getKeyColumnNames() ); return isSameJoin || super.isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * Should we join this association? */ protected boolean isJoinable( final JoinType joinType, final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type, final int depth) { if ( joinType == JoinType.NONE ) { return false; } if ( joinType == JoinType.INNER_JOIN ) { return true; } Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth(); final boolean tooDeep = maxFetchDepth!=null && depth >= maxFetchDepth.intValue(); return !tooDeep && !isDuplicateAssociation(lhsTable, lhsColumnNames, type); }
/** * Should we join this association? */ protected boolean isJoinable( final int joinType, final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type, final int depth ) { if (joinType<0) return false; if (joinType==JoinFragment.INNER_JOIN) return true; Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth(); final boolean tooDeep = maxFetchDepth!=null && depth >= maxFetchDepth.intValue(); return !tooDeep && !isDuplicateAssociation(lhsTable, lhsColumnNames, type); }
/** * Should we join this association? */ protected boolean isJoinable( final JoinType joinType, final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type, final int depth) { if ( joinType == JoinType.NONE ) { return false; } if ( joinType == JoinType.INNER_JOIN ) { return true; } Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth(); final boolean tooDeep = maxFetchDepth!=null && depth >= maxFetchDepth.intValue(); return !tooDeep && !isDuplicateAssociation(lhsTable, lhsColumnNames, type); }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation(final String lhsTable, final String[] lhsColumnNames, final AssociationType type) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation(final String lhsTable, final String[] lhsColumnNames, final AssociationType type) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation( final String lhsTable, final String[] lhsColumnNames, final AssociationType type ) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
final boolean dupe = isDuplicateAssociation(lhsTable, lhsColumns, type); if (dupe) return -1;
return JoinType.NONE; if ( isDuplicateAssociation( lhsTable, lhsColumns, associationType ) ) { return JoinType.NONE;
return JoinType.NONE; if ( isDuplicateAssociation( lhsTable, lhsColumns, associationType ) ) { return JoinType.NONE;