db4o |

# Query.Constrain Method

adds a constraint to this node.

Constraint Constrain(
object constraint
);

#### Parameters

constraint
  the constraint to be added to this Query.

#### Return Value

com.db4o.query.Constraint a new com.db4o.query.Constraint for this query node or

    null

for objects implementing the com.db4o.query.Evaluation interface.

#### Remarks

adds a constraint to this node.
If the constraint contains attributes that are not yet present in the query graph, the query graph is extended accordingly.
Special behaviour for:

- class Class : confine the result to objects of one class or to objects implementing an interface.
- interface com.db4o.query.Evaluation : run evaluation callbacks against all candidates.

#### See Also

Query Interface | com.db4o.query Namespace