// JOINS
Iterator joinIter = persistentClass.getJoinClosureIterator();
int j = 1;
while ( joinIter.hasNext() ) {
Join join = (Join) joinIter.next();
qualifiedTableNames[j] = join.getTable().getQualifiedName(
factory.getDialect(),
factory.getSettings().getDefaultCatalogName(),
factory.getSettings().getDefaultSchemaName()
);
isInverseTable[j] = join.isInverse();
isNullableTable[j] = join.isOptional();
cascadeDeleteEnabled[j] = join.getKey().isCascadeDeleteEnabled() &&
factory.getDialect().supportsCascadeDelete();
customSQLInsert[j] = join.getCustomSQLInsert();
insertCallable[j] = customSQLInsert[j] != null && join.isCustomInsertCallable();
insertResultCheckStyles[j] = join.getCustomSQLInsertCheckStyle() == null
? ExecuteUpdateResultCheckStyle.determineDefault( customSQLInsert[j], insertCallable[j] )
: join.getCustomSQLInsertCheckStyle();
customSQLUpdate[j] = join.getCustomSQLUpdate();
updateCallable[j] = customSQLUpdate[j] != null && join.isCustomUpdateCallable();
updateResultCheckStyles[j] = join.getCustomSQLUpdateCheckStyle() == null
? ExecuteUpdateResultCheckStyle.determineDefault( customSQLUpdate[j], updateCallable[j] )
: join.getCustomSQLUpdateCheckStyle();
customSQLDelete[j] = join.getCustomSQLDelete();
deleteCallable[j] = customSQLDelete[j] != null && join.isCustomDeleteCallable();
deleteResultCheckStyles[j] = join.getCustomSQLDeleteCheckStyle() == null
? ExecuteUpdateResultCheckStyle.determineDefault( customSQLDelete[j], deleteCallable[j] )
: join.getCustomSQLDeleteCheckStyle();
Iterator iter = join.getKey().getColumnIterator();
keyColumnNames[j] = new String[ join.getKey().getColumnSpan() ];
int i = 0;
while ( iter.hasNext() ) {
Column col = (Column) iter.next();
keyColumnNames[j][i++] = col.getQuotedName( factory.getDialect() );
}
j++;
}
constraintOrderedTableNames = new String[qualifiedTableNames.length];
constraintOrderedKeyColumnNames = new String[qualifiedTableNames.length][];
for ( int i = qualifiedTableNames.length - 1, position = 0; i >= 0; i--, position++ ) {
constraintOrderedTableNames[position] = qualifiedTableNames[i];
constraintOrderedKeyColumnNames[position] = keyColumnNames[i];
}
spaces = ArrayHelper.join(
qualifiedTableNames,
ArrayHelper.toStringArray( persistentClass.getSynchronizedTables() )
);
final boolean lazyAvailable = isInstrumented();
boolean hasDeferred = false;
ArrayList subclassTables = new ArrayList();
ArrayList joinKeyColumns = new ArrayList();
ArrayList<Boolean> isConcretes = new ArrayList<Boolean>();
ArrayList<Boolean> isDeferreds = new ArrayList<Boolean>();
ArrayList<Boolean> isInverses = new ArrayList<Boolean>();
ArrayList<Boolean> isNullables = new ArrayList<Boolean>();
ArrayList<Boolean> isLazies = new ArrayList<Boolean>();
subclassTables.add( qualifiedTableNames[0] );
joinKeyColumns.add( getIdentifierColumnNames() );
isConcretes.add(Boolean.TRUE);
isDeferreds.add(Boolean.FALSE);
isInverses.add(Boolean.FALSE);
isNullables.add(Boolean.FALSE);
isLazies.add(Boolean.FALSE);
joinIter = persistentClass.getSubclassJoinClosureIterator();
while ( joinIter.hasNext() ) {
Join join = (Join) joinIter.next();
isConcretes.add( persistentClass.isClassOrSuperclassJoin(join) );
isDeferreds.add( join.isSequentialSelect() );
isInverses.add( join.isInverse() );
isNullables.add( join.isOptional() );
isLazies.add( lazyAvailable && join.isLazy() );
if ( join.isSequentialSelect() && !persistentClass.isClassOrSuperclassJoin(join) ) hasDeferred = true;
subclassTables.add( join.getTable().getQualifiedName(
factory.getDialect(),
factory.getSettings().getDefaultCatalogName(),
factory.getSettings().getDefaultSchemaName()
) );
Iterator iter = join.getKey().getColumnIterator();
String[] keyCols = new String[ join.getKey().getColumnSpan() ];
int i = 0;
while ( iter.hasNext() ) {
Column col = (Column) iter.next();
keyCols[i++] = col.getQuotedName( factory.getDialect() );
}