/** * INTERNAL: */ public boolean isDowncast() { if (this.isDowncast == null) { this.getDescriptor();//initializes isDowncast } return this.isDowncast; }
/** * INTERNAL: */ public boolean isDowncast() { if (this.isDowncast == null) { this.getDescriptor();//initializes isDowncast } return this.isDowncast; }
public void validateNode() { typeExpressionBase.validateNode(); //getDescriptor currently checks if the descriptor can be found for the castclass. //We may want to check that this is a downcast in future getDescriptor(); }
public void validateNode() { typeExpressionBase.validateNode(); //getDescriptor currently checks if the descriptor can be found for the castclass. //We may want to check that this is a downcast in future getDescriptor(); }
/** * INTERNAL: * much like getOwnedTables(), this gets the tables represented from the descriptor. Difference is this only returns local tables * for the child casted descriptor, and excludes tables owned by the parent descriptor */ public List<DatabaseTable> getOwnedSubTables() { ClassDescriptor parentDescriptor = this.typeExpressionBase.getDescriptor(); Vector<DatabaseTable> childTables = new Vector(2); if (parentDescriptor.hasInheritance() && parentDescriptor.getInheritancePolicy().hasMultipleTableChild() ) { List parentTables = typeExpressionBase.getOwnedTables(); //All tables for this child, including parent tables Vector<DatabaseTable> tables = getDescriptor().getTables(); for (DatabaseTable table : tables) { if (!parentTables.contains(table)) { childTables.add(table); } } } return childTables; }
public Expression getTypeClause() { if (typeExpression == null) { if (getDescriptor() !=null && isDowncast()) { InheritancePolicy ip = this.getDescriptor().getInheritancePolicy(); if (ip.isChildDescriptor()) {//or use the isDowncast flag. Don't need to do anything if its not a downcast //equivalent to typeExpressionBase.type().in(this.getDescriptor().getInheritancePolicy().getChildClasses()) typeExpression = ip.getWithAllSubclassesExpression(); if (typeExpression == null ) { typeExpression = typeExpressionBase.type().equal(this.getDescriptor().getJavaClass()); } else { typeExpression = this.typeExpressionBase.twist(typeExpression, typeExpressionBase); } } } else { typeExpression = this.getBuilder();//equivalent to an empty expression. } } return typeExpression; }
public Expression getTypeClause() { if (typeExpression == null) { if (getDescriptor() !=null && isDowncast()) { InheritancePolicy ip = this.getDescriptor().getInheritancePolicy(); if (ip.isChildDescriptor()) {//or use the isDowncast flag. Don't need to do anything if its not a downcast //equivalent to typeExpressionBase.type().in(this.getDescriptor().getInheritancePolicy().getChildClasses()) typeExpression = ip.getWithAllSubclassesExpression(); if (typeExpression == null ) { typeExpression = typeExpressionBase.type().equal(this.getDescriptor().getJavaClass()); } else { typeExpression = this.typeExpressionBase.twist(typeExpression, typeExpressionBase); } } } else { typeExpression = this.getBuilder();//equivalent to an empty expression. } } return typeExpression; }
if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables();//All this child's tables tableSize = tables.size(); List childrenTables = getDescriptor().getInheritancePolicy().getChildrenTables(); tableSize = childrenTables.size(); for (int i=0; i < tableSize; i++) { DatabaseTable table = (DatabaseTable)childrenTables.get(i); Expression joinExpression = getDescriptor().getInheritancePolicy().getChildrenTablesJoinExpressions().get(table); joinExpression = this.baseExpression.twist(joinExpression, this); tablesJoinExpressions.put(table, joinExpression);
if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables();//All this child's tables tableSize = tables.size(); List childrenTables = getDescriptor().getInheritancePolicy().getChildrenTables(); tableSize = childrenTables.size(); for (int i=0; i < tableSize; i++) { DatabaseTable table = (DatabaseTable)childrenTables.get(i); Expression joinExpression = getDescriptor().getInheritancePolicy().getChildrenTablesJoinExpressions().get(table); joinExpression = this.baseExpression.twist(joinExpression, this); tablesJoinExpressions.put(table, joinExpression);
/** * INTERNAL: * much like getOwnedTables(), this gets the tables represented from the descriptor. Difference is this only returns local tables * for the child casted descriptor, and excludes tables owned by the parent descriptor */ public List<DatabaseTable> getOwnedSubTables() { ClassDescriptor parentDescriptor = this.typeExpressionBase.getDescriptor(); Vector<DatabaseTable> childTables = new Vector(2); if (parentDescriptor.hasInheritance() && parentDescriptor.getInheritancePolicy().hasMultipleTableChild() ) { List parentTables = typeExpressionBase.getOwnedTables(); //All tables for this child, including parent tables Vector<DatabaseTable> tables = getDescriptor().getTables(); for (DatabaseTable table : tables) { if (!parentTables.contains(table)) { childTables.add(table); } } } return childTables; }
/** * INTERNAL: * Return the expression to join the main table of this node to any auxiliary tables. */ public Expression additionalTreatExpressionCriteria() { if (getDescriptor() == null) { return null; } //need to build this using just the multiple tables on this descriptor not included in the parent's join expression Expression criteria = null; if(getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { if(isUsingOuterJoinForMultitableInheritance()) { criteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression(); criteria = this.baseExpression.twist(criteria, this); criteria.convertToUseOuterJoin(); } } return criteria; }
/** * INTERNAL: * Return the expression to join the main table of this node to any auxiliary tables. */ public Expression additionalTreatExpressionCriteria() { if (getDescriptor() == null) { return null; } //need to build this using just the multiple tables on this descriptor not included in the parent's join expression Expression criteria = null; if(getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { if(isUsingOuterJoinForMultitableInheritance()) { criteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression(); criteria = this.baseExpression.twist(criteria, this); criteria.convertToUseOuterJoin(); } } return criteria; }
if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables();//This child's tables ClassDescriptor parentDescriptor = this.typeExpressionBase.getDescriptor(); int tablesSize = tables.size();
if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables();//This child's tables ClassDescriptor parentDescriptor = this.typeExpressionBase.getDescriptor(); int tablesSize = tables.size();