/** * INTERNAL: * The reference class has been changed, need to reset the * descriptor. Null out the current descriptor and call * checkDescriptor * Added Feb 27, 2001 JED for EJBQL feature */ public void changeDescriptor(AbstractSession theSession) { setDescriptor(null); checkDescriptor(theSession); }
/** * INTERNAL: * The reference class has been changed, need to reset the * descriptor. Null out the current descriptor and call * checkDescriptor * Added Feb 27, 2001 JED for EJBQL feature */ public void changeDescriptor(AbstractSession theSession) { setDescriptor(null); checkDescriptor(theSession); }
/** * INTERNAL: * The reference class has been changed, need to reset the * descriptor. Null out the current descriptor and call * checkDescriptor * Added Feb 27, 2001 JED for EJBQL feature */ public void changeDescriptor(AbstractSession theSession) { setDescriptor(null); checkDescriptor(theSession); }
/** * INTERNAL: * Ensure that the descriptor has been set. * @param session Current session. */ @Override public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor = session.getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. */ @Override public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor = session.getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
/** * INTERNAL: * Ensure that the descriptor has been set. */ public void checkDescriptor(AbstractSession session) throws QueryException { if (this.descriptor == null) { if (getReferenceClass() == null) { throw QueryException.referenceClassMissing(this); } ClassDescriptor referenceDescriptor = session.getDescriptor(getReferenceClass()); if (referenceDescriptor == null) { throw QueryException.descriptorIsMissing(getReferenceClass(), this); } setDescriptor(referenceDescriptor); } }
concreteQuery.setDescriptor(concreteDescriptor); Vector concreteRows = ((ExpressionQueryMechanism)concreteQuery.getQueryMechanism()).selectAllRowsFromConcreteTable(); rows = Helper.concatenateVectors(rows, concreteRows);
concreteQuery.setDescriptor(concreteDescriptor); Vector concreteRows = ((ExpressionQueryMechanism)concreteQuery.getQueryMechanism()).selectAllRowsFromConcreteTable(); rows = Helper.concatenateVectors(rows, concreteRows);
/** * INTERNAL: * Select all rows from a abstract table descriptor. * This is accomplished by selecting for all of the concrete classes and then merging the rows. * This does not optimize using type select, as the type information is not known. * @return vector containing database rows. * @exception DatabaseException - an error has occurred on the database. */ protected Vector selectAllRowUsingCustomMultipleTableSubclassRead(ObjectLevelReadQuery query) throws DatabaseException { Vector rows = new Vector(); // CR#3701077, it must either have a filter only instances expression, or not have subclasses. // This method recurses, so even though this is only called when shouldReadSubclasses is true, it may be false for subclasses. if ((getOnlyInstancesExpression() != null) || (! shouldReadSubclasses())) { ObjectLevelReadQuery concreteQuery = (ObjectLevelReadQuery)query.clone(); concreteQuery.setReferenceClass(getDescriptor().getJavaClass()); concreteQuery.setDescriptor(getDescriptor()); Vector concreteRows = ((ExpressionQueryMechanism)concreteQuery.getQueryMechanism()).selectAllRowsFromConcreteTable(); rows = Helper.concatenateVectors(rows, concreteRows); } // Recursively collect all rows from all concrete children and their children. // If this descriptor did not have a child with its own table, then the concrete select // would have selected them all. if (hasMultipleTableChild() || !shouldReadSubclasses()) { for (ClassDescriptor concreteDescriptor : getChildDescriptors()) { Vector concreteRows = concreteDescriptor.getInheritancePolicy().selectAllRowUsingCustomMultipleTableSubclassRead(query); rows = Helper.concatenateVectors(rows, concreteRows); } } return rows; }
/** * INTERNAL: * Select all rows from a abstract table descriptor. * This is accomplished by selecting for all of the concrete classes and then merging the rows. * This does not optimize using type select, as the type information is not known. * @return vector containing database rows. * @exception DatabaseException - an error has occurred on the database. */ protected Vector selectAllRowUsingCustomMultipleTableSubclassRead(ObjectLevelReadQuery query) throws DatabaseException { Vector rows = new Vector(); // CR#3701077, it must either have a filter only instances expression, or not have subclasses. // This method recurses, so even though this is only called when shouldReadSubclasses is true, it may be false for subclasses. if ((getOnlyInstancesExpression() != null) || (! shouldReadSubclasses())) { ObjectLevelReadQuery concreteQuery = (ObjectLevelReadQuery)query.clone(); concreteQuery.setReferenceClass(getDescriptor().getJavaClass()); concreteQuery.setDescriptor(getDescriptor()); Vector concreteRows = ((ExpressionQueryMechanism)concreteQuery.getQueryMechanism()).selectAllRowsFromConcreteTable(); rows = Helper.concatenateVectors(rows, concreteRows); } // Recursively collect all rows from all concrete children and their children. // If this descriptor did not have a child with its own table, then the concrete select // would have selected them all. if (hasMultipleTableChild() || !shouldReadSubclasses()) { for (ClassDescriptor concreteDescriptor : getChildDescriptors()) { Vector concreteRows = concreteDescriptor.getInheritancePolicy().selectAllRowUsingCustomMultipleTableSubclassRead(query); rows = Helper.concatenateVectors(rows, concreteRows); } } return rows; }
concreteQuery = (ObjectLevelReadQuery)query.deepClone(); concreteQuery.setReferenceClass(javaClass); concreteQuery.setDescriptor(this.descriptor);
concreteQuery = (ObjectLevelReadQuery)query.deepClone(); concreteQuery.setReferenceClass(javaClass); concreteQuery.setDescriptor(this.descriptor);