TechTalk Genome v4.2


extentof( type )
A type specifying a persistent class in the current data domain schema.

Return Value

A Set<T> containing all instances of type.


Extents provide a fundamental starting point in OQL to conduct queries for persistent objects. All persistent types, including abstract and concrete classes, have an extent in every DataDomain they are persistent in. The extent of a persistent type returns a Set<T> containing all instances of the class.

Extents in OQL are similar to the concept of tables in T-SQL, but an extent is not necessarily identical to any single table in the relational database server. Another difference is that, as opposed to data tables, extents can be polymorphic, i.e. an extent returns a set of all direct or indirect instances of the given persistent type. This is often achieved by joining multiple data tables in the underlying relational database server. The element type of the resulting Set<T> is T, that being the most concrete common interface implemented by all returned persistent objects.

Similarly to the FROM clause of a T-SQL query, extents can be further filtered, projected or sorted to form the final query for the concerned persistent objects. However filtering, projection and sorting are formalized as clauses of one statement (in this case the SELECT statement)in T-SQL, OQL defines filtering, projection and sorting as individual operations that take a source Set as an argument, perform data manipulation on this source set and return another Set as a result. This behaviour enables complex problems to be fully decomposed in OQL - a feature implemented with blood and tears in T-SQL.

Quick Reference


Set<Animal> animals = myDB.Extent<Animal>();


See Also

DataDomain.Extent | OqlReference.Chapter3