if (isPrepared() || (!shouldPrepare() && ((QueryByExampleMechanism)getQueryMechanism()).isParsed())) { ((QueryByExampleMechanism)getQueryMechanism()).setIsParsed(false); setSelectionCriteria(null);
if (isPrepared() || (!shouldPrepare() && ((QueryByExampleMechanism)getQueryMechanism()).isParsed())) { ((QueryByExampleMechanism)getQueryMechanism()).setIsParsed(false); setSelectionCriteria(null);
if (isPrepared() || (!shouldPrepare() && ((QueryByExampleMechanism)getQueryMechanism()).isParsed())) { ((QueryByExampleMechanism)getQueryMechanism()).setIsParsed(false); setSelectionCriteria(null);
/** * PUBLIC: * The QueryByExamplePolicy, is a useful to customize the query when Query By Example is used. * The policy will control what attributes should, or should not be included in the query. * When dealing with nulls, using special operations (notEqual, lessThan, like, etc.) * for comparison, or choosing to include certain attributes at all times, it is useful to modify * the policy accordingly. * <p>Once a query is executed you must make an explicit call to setQueryByExamplePolicy * when changing the policy, so the query will know to prepare itself again. * <p>There is a caution to setting both a selection criteria and an example object: * If you set the policy after execution you must also reset the selection criteria. * (This is because after execution the original criteria and Query By Example criteria are fused together, * and the former cannot be easily recovered). */ public void setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy) { if (!getQueryMechanism().isQueryByExampleMechanism()) { setQueryMechanism(new QueryByExampleMechanism(this, getSelectionCriteria())); ((QueryByExampleMechanism)getQueryMechanism()).setQueryByExamplePolicy(queryByExamplePolicy); setIsPrepared(false); } else { ((QueryByExampleMechanism)getQueryMechanism()).setQueryByExamplePolicy(queryByExamplePolicy); // Must allow the query to be prepared again. if (isPrepared() || (!shouldPrepare() && ((QueryByExampleMechanism)getQueryMechanism()).isParsed())) { ((QueryByExampleMechanism)getQueryMechanism()).setIsParsed(false); setSelectionCriteria(null); // setIsPrepared(false) triggered by previous. } } setIsPrePrepared(false); }
/** * PUBLIC: * The QueryByExamplePolicy, is a useful to customize the query when Query By Example is used. * The policy will control what attributes should, or should not be included in the query. * When dealing with nulls, using special operations (notEqual, lessThan, like, etc.) * for comparison, or choosing to include certain attributes at all times, it is useful to modify * the policy accordingly. * <p>Once a query is executed you must make an explicit call to setQueryByExamplePolicy * when changing the policy, so the query will know to prepare itself again. * <p>There is a caution to setting both a selection criteria and an example object: * If you set the policy after execution you must also reset the selection criteria. * (This is because after execution the original criteria and Query By Example criteria are fused together, * and the former cannot be easily recovered). */ public void setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy) { if (!getQueryMechanism().isQueryByExampleMechanism()) { setQueryMechanism(new QueryByExampleMechanism(this, getSelectionCriteria())); ((QueryByExampleMechanism)getQueryMechanism()).setQueryByExamplePolicy(queryByExamplePolicy); setIsPrepared(false); } else { ((QueryByExampleMechanism)getQueryMechanism()).setQueryByExamplePolicy(queryByExamplePolicy); // Must allow the query to be prepared again. if (isPrepared() || (!shouldPrepare() && ((QueryByExampleMechanism)getQueryMechanism()).isParsed())) { ((QueryByExampleMechanism)getQueryMechanism()).setIsParsed(false); setSelectionCriteria(null); // setIsPrepared(false) triggered by previous. } } setIsPrePrepared(false); }
/** * PUBLIC: * The QueryByExamplePolicy, is a useful to customize the query when Query By Example is used. * The policy will control what attributes should, or should not be included in the query. * When dealing with nulls, using special operations (notEqual, lessThan, like, etc.) * for comparison, or choosing to include certain attributes at all times, it is useful to modify * the policy accordingly. * <p>Once a query is executed you must make an explicit call to setQueryByExamplePolicy * when changing the policy, so the query will know to prepare itself again. * <p>There is a caution to setting both a selection criteria and an example object: * If you set the policy after execution you must also reset the selection criteria. * (This is because after execution the original criteria and Query By Example criteria are fused together, * and the former cannot be easily recovered). */ public void setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy) { if (!getQueryMechanism().isQueryByExampleMechanism()) { setQueryMechanism(new QueryByExampleMechanism(this, getSelectionCriteria())); ((QueryByExampleMechanism)getQueryMechanism()).setQueryByExamplePolicy(queryByExamplePolicy); setIsPrepared(false); } else { ((QueryByExampleMechanism)getQueryMechanism()).setQueryByExamplePolicy(queryByExamplePolicy); // Must allow the query to be prepared again. if (isPrepared() || (!shouldPrepare() && ((QueryByExampleMechanism)getQueryMechanism()).isParsed())) { ((QueryByExampleMechanism)getQueryMechanism()).setIsParsed(false); setSelectionCriteria(null); // setIsPrepared(false) triggered by previous. } } setIsPrePrepared(false); }