Exemplo n.º 1
0
  /** INTERNAL: Clone the query. */
  public Object clone() {
    ReadAllQuery cloneQuery = (ReadAllQuery) super.clone();

    // Don't use setters as that will trigger unprepare
    cloneQuery.containerPolicy = getContainerPolicy().clone(cloneQuery);

    return cloneQuery;
  }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
 /** INTERNAL: Set the properties needed to be cascaded into the custom query. */
 protected void prepareCustomQuery(DatabaseQuery customQuery) {
   ReadAllQuery customReadQuery = (ReadAllQuery) customQuery;
   customReadQuery.setContainerPolicy(getContainerPolicy());
   customReadQuery.setCascadePolicy(getCascadePolicy());
   customReadQuery.setShouldRefreshIdentityMapResult(shouldRefreshIdentityMapResult());
   customReadQuery.setShouldMaintainCache(shouldMaintainCache());
   customReadQuery.setShouldUseWrapperPolicy(shouldUseWrapperPolicy());
 }
Exemplo n.º 4
0
 /**
  * INTERNAL: Prepare the query from the prepared query. This allows a dynamic query to prepare
  * itself directly from a prepared query instance. This is used in the JPQL parse cache to allow
  * preparsed queries to be used to prepare dynamic queries. This only copies over properties that
  * are configured through JPQL.
  */
 public void prepareFromQuery(DatabaseQuery query) {
   super.prepareFromQuery(query);
   if (query.isReadAllQuery()) {
     ReadAllQuery readQuery = (ReadAllQuery) query;
     this.containerPolicy = readQuery.containerPolicy;
     if (readQuery.hasHierarchicalExpressions()) {
       this.orderSiblingsByExpressions = readQuery.getOrderSiblingsByExpressions();
       this.connectByExpression = readQuery.getConnectByExpression();
       this.startWithExpression = readQuery.getStartWithExpression();
     }
     if (readQuery.hasBatchReadAttributes()) {
       this.batchReadAttributeExpressions = readQuery.batchReadAttributeExpressions;
       this.batchReadMappingQueries = readQuery.batchReadMappingQueries;
       this.batchReadAttributes = readQuery.batchReadAttributes;
     }
   }
 }