/** * Prepare and validate. * Allow subclasses to override. */ public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if (query.isReadAllQuery() && (!query.isReportQuery()) && query.shouldUseWrapperPolicy()) { setElementDescriptor(query.getDescriptor()); //make sure DataReadQuery points to this container policy } else if (query.isDataReadQuery()) { ((DataReadQuery)query).setContainerPolicy(this); } }
/** * Prepare and validate. * Allow subclasses to override. */ public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if (query.isReadAllQuery() && (!query.isReportQuery()) && query.shouldUseWrapperPolicy()) { setElementDescriptor(query.getDescriptor()); //make sure DataReadQuery points to this container policy } else if (query.isDataReadQuery()) { ((DataReadQuery)query).setContainerPolicy(this); } }
/** * Prepare and validate. * Allow subclasses to override. */ public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if (query.isReadAllQuery() && (!query.isReportQuery()) && query.shouldUseWrapperPolicy()) { setElementDescriptor(query.getDescriptor()); //make sure DataReadQuery points to this container policy } else if (query.isDataReadQuery()) { ((DataReadQuery)query).setContainerPolicy(this); } }
/** * INTERNAL: * Return true if the query uses default properties. * This is used to determine if this query is cacheable. * i.e. does not use any properties that may conflict with another query * with the same EJBQL or selection criteria. */ public boolean isDefaultPropertiesQuery() { return (!isUserDefined()) && (shouldPrepare()) && (getQueryTimeout() == DescriptorQueryManager.DefaultTimeout) && (getHintString() == null) && (shouldIgnoreBindAllParameters()) && (shouldIgnoreCacheStatement()) && (shouldUseWrapperPolicy()); }
method.addLine(queryIdentifier + ".setQueryTimeout(" + String.valueOf(query.getQueryTimeout()) + ");"); if (!query.shouldUseWrapperPolicy()) { method.addLine(queryIdentifier + ".setShouldUseWrapperPolicy(" + String.valueOf(query.shouldUseWrapperPolicy()) + ");");
method.addLine(queryIdentifier + ".setQueryTimeout(" + String.valueOf(query.getQueryTimeout()) + ");"); if (!query.shouldUseWrapperPolicy()) { method.addLine(queryIdentifier + ".setShouldUseWrapperPolicy(" + String.valueOf(query.shouldUseWrapperPolicy()) + ");");
method.addLine(queryIdentifier + ".setQueryTimeout(" + String.valueOf(query.getQueryTimeout()) + ");"); if (!query.shouldUseWrapperPolicy()) { method.addLine(queryIdentifier + ".setShouldUseWrapperPolicy(" + String.valueOf(query.shouldUseWrapperPolicy()) + ");");