BBQ supports several data types, which are arranged in a derivation hierarchy. All types are derived, directly or indirectly, from the base type object.
Note that the type Type represents a type in Java (such as int, boolean, etc.) which is a completely different than types within the query language.
Set expressions have a type, which is the most-derived common type of all the objects in the resulting set. Filters and transforms may be applicable to only some types; BBQ determines the type of the expression at every point of transform using these rules:
Combining expressions with set operators produces a compound expression; if the two set expressions have different types than the type of the compound expression is the most-derived type that is the ancestor of both constituent types in the set expression.
Similarly, combining filters with a logical operator produces a compound filter. If the two filters are applicable to different types, the applicable type for one of the filters must be derived from the applicable type of the other filter, and the applicable type of the compound filter is the most-derived type.
When you combine two transforms with a set operator, both kinds of type resolution may happen. If the transforms have different applicable types, one must derive from the other and the applicable type of the compound transform is the most derived type. If the transforms have different result types, the result type of the compound transform is the most-derived type that is an ancestor of each of the constituent result types.
|browse-by-query home||antlersoft free software||sourceforge project page|