예제 #1
0
 /**
  * INTERNAL: Return if the query is equal to the other. This is used to allow dynamic expression
  * query SQL to be cached.
  */
 public boolean equals(Object object) {
   if (this == object) {
     return true;
   }
   if (!super.equals(object)) {
     return false;
   }
   ReadAllQuery query = (ReadAllQuery) object;
   if (!getContainerPolicy().equals(query.getContainerPolicy())) {
     return false;
   }
   return true;
 }
  /**
   * INTERNAL: Select all objects for an interface descriptor. This is accomplished by selecting for
   * all of the concrete classes and then merging the objects.
   *
   * @return Vector containing all objects.
   * @exception DatabaseException - an error has occurred on the database.
   */
  public Object selectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query)
      throws DatabaseException {
    org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy =
        query.getContainerPolicy();
    Object objects = containerPolicy.containerInstance(1);

    for (Enumeration childDescriptors = getChildDescriptors().elements();
        childDescriptors.hasMoreElements(); ) {
      ClassDescriptor descriptor = (ClassDescriptor) childDescriptors.nextElement();
      objects =
          containerPolicy.concatenateContainers(
              objects, descriptor.getInterfacePolicy().selectAllObjects(query));
    }

    return objects;
  }