[[alias:] select-clause [distinct]]set
An identifier used to alias the candidate element of set. If alias is specified, the
this keyword refers to the candidate element declared in any outer scope (the semantics of the
this keyword are
not altered when an explicit alias is used).
If omitted, the
this keyword can be used to refer to the candidate element of set.
An OQL implicit function executed on candidate elements of set, returning a scalar, persistent, transient or object array expression.
The return value of select-clause is stored in the resulting Set<T>.
alias (if declared) can be used to refer to the candidate element of set.
Identifiers declared in outer scopes of the expression can be freely used within select-clause.
If specified, the resulting set contains only distinct values.
An OQL expression returning a Set<T> of scalars or persistent objects.
A Set<T> containing return values of select-clause evaluated for all
elements of set.
The select-clause expression is evaluated for each element of set and the
results of this evaluation are stored in the resulting Set<T> returned by this expression.
If the distinct keyword is specified, the resulting set contains each element only once;
otherwise, the count of elements returned in the resulting set is identical to the count of set.
alias (if present) can be used to refer to the candidate element of set; otherwise,
the this keyword can be used.
OQL accords filtering a higher operator precedence than projection. Therefore, the query
is identical to
Set<Cage> cages = myDB.Extent<Animal>().Select<Cage>("Cage");
Set<Cage> cages = myDB.Extent<Animal>().Select<Cage>(true, "Cage");
SELECT Cage.* FROM Animal LEFT OUTER JOIN Cage ON Animal.CageId = Cage.Id
SELECT DISTINCT Cage.* FROM Animal LEFT OUTER JOIN Cage ON Animal.CageId = Cage.Id
Set<T>.Select<S> | Implicit Functions | Filtering | OqlReference.Chapter5