* (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.