Chili.Opf3 Send comments on this topic.
CompiledQuery Class
See Also  Members   Example 
Chili.Opf3.Query Namespace : CompiledQuery Class




This class represents a storage dependent query.

Object Model


Syntax

Visual Basic (Declaration) 
Public NotInheritable Class CompiledQuery 
   Implements IQuery 
Visual Basic (Usage)Copy Code
Dim instance As CompiledQuery
C# 
public sealed class CompiledQuery : IQuery  
Managed Extensions for C++ 
public __gc __sealed class CompiledQuery : public IQuery  
C++/CLI 
public ref class CompiledQuery sealed : public IQuery  

Example

The following example shows how to use the OPath and ObjectExpression class to create a CompiledQuery from a ObjectQuery .
C#Copy Code
// ... Other code 
  
// Create an ObjectQuery for User persistent objects and 
// add a condition to load only user with a name that contains "hri" 
ObjectQuery<User> objectQuery =  
new ObjectQuery<User>("UserName like {0}", "%hri%"); 
  
// Create an ObjectExpression by parsing the ObjectQuery. 
ObjectExpression objectExpresion = OPath.Parse(objectQuery); 
  
// Compile the ObjectExpression to get a CompildQuery. 
// You have to set the storage that is used to compile the query. 
CompiledQuery compiled = objectExpression.ToCompiledQuery(ObjectContext.Storage); 
  
// ... Other code 
    

Remarks

This query is storage dependent. It is created from any other query type and can only be executed on the storage it has been compiled for. If you create a CompiledQuery for MsSql Server (for example) you can execute the query only on a MsSql Server storage.

A CompiledQuery is generated by invoking the ToCompiledQuery routine of a class that implements the IQuery interface.

Inheritance Hierarchy

System.Object
   Chili.Opf3.Query.CompiledQuery

Requirements

Namespace: Chili.Opf3.Query

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also