Module: DataMapper::Query::Conditions

Module | DataMapper::Query::Conditions
In: | lib/dm-core/query/conditions/comparison.rb lib/dm-core/query/conditions/operation.rb

The Conditions module contains classes used as part of a Query when filtering collections of resources.

The Conditions module contains two types of class used for filtering queries: Comparison and Operation. Although these are used on all repositorie types — not just SQL-based repos — these classes are best thought of as being the DataMapper counterpart to an SQL WHERE clause.

Comparisons compare properties and relationships with values, while operations tie Comparisons together to form more complex expressions.

For example, the following SQL query fragment:

      ... WHERE my_field = my_value AND another_field = another_value ...

… would be represented as two EqualToComparison instances tied together with an AndOperation.

Conditions — together with the Query class — allow DataMapper to represent SQL-like expressions in an ORM-agnostic manner, and are used for both in-memory filtering of loaded Collection instances, and by adapters to retrieve records directly from your repositories.

The classes contained in the Conditions module are for internal use by DataMapper and DataMapper plugins, and are not intended to be used directly in your applications.

### Classes and Modules

Module DataMapper::Query::Conditions::FlattenOperation
Module DataMapper::Query::Conditions::RelationshipHandler
Class DataMapper::Query::Conditions::AbstractComparison
Class DataMapper::Query::Conditions::AbstractOperation
Class DataMapper::Query::Conditions::AndOperation
Class DataMapper::Query::Conditions::Comparison
Class DataMapper::Query::Conditions::EqualToComparison
Class DataMapper::Query::Conditions::GreaterThanComparison
Class DataMapper::Query::Conditions::GreaterThanOrEqualToComparison
Class DataMapper::Query::Conditions::InclusionComparison
Class DataMapper::Query::Conditions::InvalidOperation
Class DataMapper::Query::Conditions::LessThanComparison
Class DataMapper::Query::Conditions::LessThanOrEqualToComparison
Class DataMapper::Query::Conditions::LikeComparison
Class DataMapper::Query::Conditions::NotOperation
Class DataMapper::Query::Conditions::NullOperation
Class DataMapper::Query::Conditions::Operation
Class DataMapper::Query::Conditions::OrOperation
Class DataMapper::Query::Conditions::RegexpComparison

[Validate]