@Override public DatabaseTable aliasForTable(DatabaseTable table) { return typeExpressionBase.aliasForTable(table); }
@Override public DatabaseTable aliasForTable(DatabaseTable table) { return typeExpressionBase.aliasForTable(table); }
/** * Alias the supplied fields with respect to the expression node. Return copies of the fields */ protected Vector aliasFields(ObjectExpression node, Vector fields) { Vector result = new Vector(fields.size()); for (Enumeration e = fields.elements(); e.hasMoreElements();) { DatabaseField eachField = ((DatabaseField)e.nextElement()).clone(); eachField.setTable(node.aliasForTable(eachField.getTable())); result.addElement(eachField); } return result; }
/** * Alias the supplied fields with respect to the expression node. Return copies of the fields */ protected Vector aliasFields(ObjectExpression node, Vector fields) { Vector result = new Vector(fields.size()); for (Enumeration e = fields.elements(); e.hasMoreElements();) { DatabaseField eachField = ((DatabaseField)e.nextElement()).clone(); eachField.setTable(node.aliasForTable(eachField.getTable())); result.addElement(eachField); } return result; }
/** * Alias the supplied fields with respect to the expression node. Return copies of the fields */ protected Vector aliasFields(ObjectExpression node, Vector fields) { Vector result = new Vector(fields.size()); for (Enumeration e = fields.elements(); e.hasMoreElements();) { DatabaseField eachField = (DatabaseField)((DatabaseField)e.nextElement()).clone(); eachField.setTable(node.aliasForTable(eachField.getTable())); result.addElement(eachField); } return result; }
/** * INTERNAL: Find the alias for a given table. Handle the special case where we are bogus * and it should be aliased against our derived tables instead. */ public DatabaseTable aliasForTable(DatabaseTable table) { if (hasViewTable()) { return getAliasedViewTable(); } if (doesNotRepresentAnObjectInTheQuery()) { for (Enumeration e = derivedTables.elements(); e.hasMoreElements();) { TableExpression t = (TableExpression)e.nextElement(); DatabaseTable result = t.aliasForTable(table); if (result != null) { return result; } } } else { return super.aliasForTable(table); } return null;// No alias found in the derived tables }
/** * INTERNAL: Find the alias for a given table. Handle the special case where we are bogus * and it should be aliased against our derived tables instead. */ public DatabaseTable aliasForTable(DatabaseTable table) { if (hasViewTable()) { return getAliasedViewTable(); } if (doesNotRepresentAnObjectInTheQuery()) { for (Expression expression : this.derivedTables) { DatabaseTable result = expression.aliasForTable(table); if (result != null) { return result; } } } else { return super.aliasForTable(table); } return null; // No alias found in the derived tables }
/** * INTERNAL: Find the alias for a given table. Handle the special case where we are bogus * and it should be aliased against our derived tables instead. */ public DatabaseTable aliasForTable(DatabaseTable table) { if (hasViewTable()) { return getAliasedViewTable(); } if (doesNotRepresentAnObjectInTheQuery()) { for (Expression expression : this.derivedTables) { DatabaseTable result = expression.aliasForTable(table); if (result != null) { return result; } } } else { return super.aliasForTable(table); } return null; // No alias found in the derived tables }
this.sourceAlias = this.joinExpression.getJoinSource().aliasForTable(this.sourceTable); this.targetTable = this.joinExpression.getDescriptor().getTables().get(0); this.targetAlias = this.joinExpression.aliasForTable(this.targetTable); } else {
this.sourceAlias = this.joinExpression.getJoinSource().aliasForTable(this.sourceTable); this.targetTable = this.joinExpression.getDescriptor().getTables().get(0); this.targetAlias = this.joinExpression.aliasForTable(this.targetTable); } else {
Expression item = (Expression)items.elementAt(index); if ((this.selector == Ref) || ((this.selector == Deref) && (item.isObjectExpression()))) { DatabaseTable alias = ((ObjectExpression)item).aliasForTable(((ObjectExpression)item).getDescriptor().getTables().firstElement()); printer.printString(alias.getNameDelimited(printer.getPlatform())); } else if ((this.selector == Count) && (item.isExpressionBuilder())) {
Expression item = (Expression)items.elementAt(index); if ((this.selector == Ref) || ((this.selector == Deref) && (item.isObjectExpression()))) { DatabaseTable alias = ((ObjectExpression)item).aliasForTable(((ObjectExpression)item).getDescriptor().getTables().firstElement()); printer.printString(alias.getNameDelimited(printer.getPlatform())); } else if ((this.selector == Count) && (item.isExpressionBuilder())) {
Expression item = (Expression)items.elementAt(index); if ((getSelector() == Ref) || ((getSelector() == Deref) && (item.isObjectExpression()))) { DatabaseTable alias = ((ObjectExpression)item).aliasForTable(((ObjectExpression)item).getDescriptor().getTables().firstElement()); printer.printString(alias.getNameDelimited(printer.getPlatform())); } else if ((getSelector() == Count) && (item.isExpressionBuilder())) {
DatabaseTable alias = ((ObjectExpression)item).aliasForTable(((ObjectExpression)item).getDescriptor().getTables().firstElement()); printer.printString(alias.getNameDelimited(printer.getPlatform())); } else if ((this.selector == Count) && (item.isExpressionBuilder())) {
DatabaseTable alias = ((ObjectExpression)item).aliasForTable(((ObjectExpression)item).getDescriptor().getTables().firstElement()); printer.printString(alias.getNameDelimited(printer.getPlatform())); } else if ((this.selector == Count) && (item.isExpressionBuilder())) {
/** * INTERNAL: * Find the alias for a given table */ @Override public DatabaseTable aliasForTable(DatabaseTable table) { DatabaseMapping mapping = getMapping(); if (isAttribute() || ((mapping != null) && (mapping.isAggregateObjectMapping() || mapping.isTransformationMapping()))) { return ((DataExpression)this.baseExpression).aliasForTable(table); } //"ref" and "structure" mappings, no table printed in the FROM clause, need to get the table alias form the parent table if ((mapping != null) && (mapping.isReferenceMapping() || mapping.isStructureMapping())) { DatabaseTable alias = this.baseExpression.aliasForTable(mapping.getDescriptor().getTables().firstElement()); alias.setName(alias.getName() + "." + mapping.getField().getName()); return alias; } // For direct-collection mappings the alias is store on the table expression. if ((mapping != null) && (mapping.isDirectCollectionMapping())) { if (tableAliases != null){ DatabaseTable aliasedTable = tableAliases.keyAtValue(table); if (aliasedTable != null){ return aliasedTable; } } return getTable(table).aliasForTable(table); } return super.aliasForTable(table); }
/** * INTERNAL: * Find the alias for a given table */ @Override public DatabaseTable aliasForTable(DatabaseTable table) { DatabaseMapping mapping = getMapping(); if (isAttribute() || ((mapping != null) && (mapping.isAggregateObjectMapping() || mapping.isTransformationMapping()))) { return ((DataExpression)this.baseExpression).aliasForTable(table); } //"ref" and "structure" mappings, no table printed in the FROM clause, need to get the table alias form the parent table if ((mapping != null) && (mapping.isReferenceMapping() || mapping.isStructureMapping())) { DatabaseTable alias = this.baseExpression.aliasForTable(mapping.getDescriptor().getTables().firstElement()); alias.setName(alias.getName() + "." + mapping.getField().getName()); return alias; } // For direct-collection mappings the alias is store on the table expression. if ((mapping != null) && (mapping.isDirectCollectionMapping())) { if (tableAliases != null){ DatabaseTable aliasedTable = tableAliases.keyAtValue(table); if (aliasedTable != null){ return aliasedTable; } } return getTable(table).aliasForTable(table); } return super.aliasForTable(table); }
/** * INTERNAL: * Find the alias for a given table */ public DatabaseTable aliasForTable(DatabaseTable table) { DatabaseMapping mapping = getMapping(); if (isAttribute() || ((mapping != null) && (mapping.isAggregateObjectMapping() || mapping.isTransformationMapping()))) { return ((DataExpression)getBaseExpression()).aliasForTable(table); } //"ref" and "structure" mappings, no table printed in the FROM clause, need to get the table alias form the parent table if ((mapping != null) && (mapping.isReferenceMapping() || mapping.isStructureMapping())) { DatabaseTable alias = getBaseExpression().aliasForTable(mapping.getDescriptor().getTables().firstElement()); alias.setName(alias.getName() + "." + mapping.getField().getName()); return alias; } // For direct-collection mappings the alias is store on the table expression. if ((mapping != null) && (mapping.isDirectCollectionMapping())) { if (tableAliases != null){ DatabaseTable aliasedTable = tableAliases.keyAtValue(table); if (aliasedTable != null){ return aliasedTable; } } return getTable(table).aliasForTable(table); } return super.aliasForTable(table); }