IConstraint Interface

Summary

Constraint to limit the objects returned upon Db4objects.Db4o.Query.IQuery.Execute.

Constraints are constructed by calling Db4objects.Db4o.Query.IQuery.Constrain(System.Object)

Constraints can be joined with the methods Db4objects.Db4o.Query.IConstraint.And(Db4objects.Db4o.Query.IConstraint) and Db4objects.Db4o.Query.IConstraint.Or(Db4objects.Db4o.Query.IConstraint).

The methods to modify the constraint evaluation algorithm may be merged, to construct combined evaluation rules. Examples:
  • For "smaller or equal":
    Constraint.Smaller().Equal()
  • For "not like":
    Constraint.Not().Like()
  • For "not greater or equal":
    Constraint.Not().Greater().Equal()
graph BT Type["IConstraint"] class Type type-node Implementing0["QConObject"]-.->Type click Implementing0 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConObject" Implementing1["QConClass"]-.->Type click Implementing1 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConClass" Implementing2["QConUnconditional"]-.->Type click Implementing2 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConUnconditional" Implementing3["IConstraints"]-.->Type click Implementing3 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Query/IConstraints" Implementing4["QConEvaluation"]-.->Type click Implementing4 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConEvaluation" Implementing5["QCon"]-.->Type click Implementing5 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QCon" Implementing6["QConJoin"]-.->Type click Implementing6 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConJoin" Implementing7["QConPath"]-.->Type click Implementing7 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConPath" Implementing8["QConstraints"]-.->Type click Implementing8 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal.Query.Processor/QConstraints"

Syntax

public interface IConstraint

Methods

Name Value Summary
And(IConstraint) IConstraint
Links two Constraints for AND evaluation.
ByExample() IConstraint
Set the evaluation mode to object comparison (query by example).
Contains() IConstraint
Sets the evaluation mode to string contains comparison.
EndsWith(bool) IConstraint
Sets the evaluation mode to string EndsWith comparison.
Equal() IConstraint
Used in conjunction with Db4objects.Db4o.Query.IConstraint.Smaller or Db4objects.Db4o.Query.IConstraint.Greater to create constraints like "smaller or equal", "greater or equal". For example:
query.Constrain(typeof(Pilot));
query.Descend("points").Constrain(101).Smaller().Equal();

will return all pilots with points <= 101.
GetObject() Object
Returns the Object the query graph was constrained with to create this Db4objects.Db4o.Query.IConstraint .
Greater() IConstraint
Sets the evaluation mode to >.
Identity() IConstraint
Sets the evaluation mode to identity comparison.
Like() IConstraint
Sets the evaluation mode to "like" comparison.
Not() IConstraint
Turns on Not() comparison.
Or(IConstraint) IConstraint
Links two Constraints for OR evaluation.
Smaller() IConstraint
Sets the evaluation mode to ><.
StartsWith(bool) IConstraint
Sets the evaluation mode to string StartsWith comparison.