Jump to: navigation, search

Difference between revisions of "QUERY"


Line 2: Line 2:
 
== Basics ==
 
== Basics ==
  
Queries are used for fetching a list of objects from the database. Queries will use data base mechanism for perfomant data access. Queries will deliver a list of objects of a certain [[Metaclass]].
+
In UBIK, queries are used for fetching a list of [[Contentclass|ContentClasses] from the database. Queries use data base mechanism for perfomant data access and will deliver a list of objects of a certain [[Metaclass]].
 
Queries can be used in different scenarios:  
 
Queries can be used in different scenarios:  
 
* data fetching (n records)
 
* data fetching (n records)
Line 11: Line 11:
 
== Query, QueryItem ==
 
== Query, QueryItem ==
  
A Query is defined for a single MetaClass. The MetaClass is defined by a Referenceproperty (“FILTEROBJECT”). A Query will deliver objects (instances) of the defined MetaClass.
+
A Query is defined for a single MetaClass. The MetaClass is defined by a Referenceproperty (“FILTEROBJECT”). A Query will deliver ContentClasses(instances) of the defined MetaClass.
 
A Query holds a list of QueryItems. A single QueryItem defines a single filter rule for the evaluation of the result collection:
 
A Query holds a list of QueryItems. A single QueryItem defines a single filter rule for the evaluation of the result collection:
 
* OPERATOR
 
* OPERATOR
Line 36: Line 36:
  
  
[[Category:UBIK]][[Category:How to...]]
+
[[Category:UBIK Object]]

Revision as of 12:17, 4 June 2012

Basics

In UBIK, queries are used for fetching a list of [[Contentclass|ContentClasses] from the database. Queries use data base mechanism for perfomant data access and will deliver a list of objects of a certain Metaclass. Queries can be used in different scenarios:

  • data fetching (n records)
  • finding a single or a set of recordset(s)
  • used as definition of root nodes in a View


Query, QueryItem

A Query is defined for a single MetaClass. The MetaClass is defined by a Referenceproperty (“FILTEROBJECT”). A Query will deliver ContentClasses(instances) of the defined MetaClass. A Query holds a list of QueryItems. A single QueryItem defines a single filter rule for the evaluation of the result collection:

  • OPERATOR

e.g. “=”

  • LIKECOMPARISON

is the given item a “LIKE” filter criteria (wildcard is added to the filtervalue)

  • FILTERVALUE

the value the objects are compared to

  • ISNULL

searched for NULL values

  • LOGICALAND

is there a logical AND relation between the given QueryItem and its predecessor (TRUE) or an OR relation (false)


Relation between Query and Items

The correspondence between Queries and its items is created and stored by a relationship (“QUERYRELATION”). Therefore a single QueryItem can be used several times for different Queries.


Usage of DatabaseViews

It is also possible to define a Database View and use this View for the evaluation of Queries (see VirtualContentClass).