/** * INTERNAL: * Assign aliases to any tables which I own. Start with t(initialValue), * and return the new value of the counter , i.e. if initialValue is one * and I have tables ADDRESS and EMPLOYEE I will assign them t1 and t2 respectively, and return 3. */ public int assignTableAliasesStartingAt(int initialValue) { //This assumes that the typeExpressionBase will alias its own tables, so we only need to handle //the extra's caused by this treat expression. if (hasBeenAliased()) { return initialValue; } int counter = initialValue; if (this.typeExpressionBase != null) { counter = this.typeExpressionBase.assignTableAliasesStartingAt(counter); } //Only difference between this and ObjectExpression's assignTableAliasesStartingAt is this uses getOwnedSubTables // instead of getOwnedTables which returns everything. List<DatabaseTable> ownedTables = getOwnedSubTables(); if (ownedTables != null) { for (DatabaseTable table : ownedTables) { assignAlias("t" + counter, table); counter++; } } this.hasBeenAliased = true; return counter; }
/** * INTERNAL: * Assign aliases to any tables which I own. Start with t(initialValue), * and return the new value of the counter , i.e. if initialValue is one * and I have tables ADDRESS and EMPLOYEE I will assign them t1 and t2 respectively, and return 3. */ public int assignTableAliasesStartingAt(int initialValue) { //This assumes that the typeExpressionBase will alias its own tables, so we only need to handle //the extra's caused by this treat expression. if (hasBeenAliased()) { return initialValue; } int counter = initialValue; if (this.typeExpressionBase != null) { counter = this.typeExpressionBase.assignTableAliasesStartingAt(counter); } //Only difference between this and ObjectExpression's assignTableAliasesStartingAt is this uses getOwnedSubTables // instead of getOwnedTables which returns everything. List<DatabaseTable> ownedTables = getOwnedSubTables(); if (ownedTables != null) { for (DatabaseTable table : ownedTables) { assignAlias("t" + counter, table); counter++; } } this.hasBeenAliased = true; return counter; }
return initialValue + 1; return super.assignTableAliasesStartingAt(initialValue);
return initialValue + 1; return super.assignTableAliasesStartingAt(initialValue);
return initialValue + 1; return super.assignTableAliasesStartingAt(initialValue);