package org.mongodb.morphia.query;
Defines the base Criteria implementation.
/**
* Defines the base Criteria implementation.
*/
public abstract class AbstractCriteria implements Criteria {
private CriteriaContainer attachedTo;
@Override
public void attach(final CriteriaContainer container) {
if (attachedTo != null) {
attachedTo.remove(this);
}
attachedTo = container;
}
Returns: the CriteriaContainer this Criteria is attached to
/**
* @return the CriteriaContainer this Criteria is attached to
*/
public CriteriaContainer getAttachedTo() {
return attachedTo;
}
Sets the parents CriteriaContainer for this Criteria
Params: - attachedTo – the CriteriaContainer
/**
* Sets the parents CriteriaContainer for this Criteria
*
* @param attachedTo the CriteriaContainer
*/
public void setAttachedTo(final CriteriaContainer attachedTo) {
this.attachedTo = attachedTo;
}
}