C# Class Habanero.BO.QueryBuilder

Provides utility methods that create SelectQuery objects given a set of information.
ファイルを表示 Open project: Chillisoft/habanero

Public Methods

Method Description
CreateOrderCriteria ( IClassDef classDef, string orderByString ) : IOrderCriteria

Based on the class definition and the orderByString an OrderCriteria object is created. The orderCriteria object is a set of order by fields including information on their business object properties and their dataSource.

CreateQueryField ( IClassDef classDef, string propertyName ) : QueryField

Creates a QueryField given a classdef and a property name.

CreateSelectCountQuery ( IClassDef classDef ) : ISelectQuery

Creates a select query to return the count of objects in a table for that classdef

CreateSelectCountQuery ( IClassDef classDef, Criteria criteria ) : ISelectQuery

Creates a select query to return the count of objects in a table for that classdef with the criteria

CreateSelectQuery ( IClassDef classDef ) : ISelectQuery

Creates a SelectQuery using the given classdef without any Criteria. All information in the ClassDef will be taken into account (such as inheritance structures).

CreateSelectQuery ( IClassDef classDef, Criteria criteria ) : ISelectQuery

Creates a SelectQuery using the given classdef with the given Criteria. All information in the ClassDef will be taken into account (such as inheritance structures).

PrepareCriteria ( IClassDef classDef, Criteria criteria ) : void

Based on the class definition the given Criteria object is set up with the correct entity names and field names, in preparation for using it as part of a SelectQuery that has been built using the QueryBuilder and the same ClassDef

PrepareDiscriminatorCriteria ( IClassDef classDef, Criteria criteria ) : void

PrepareField ( Source currentSource, IClassDef classDef, QueryField field ) : IPropDef

Prepares

PrepareSource ( IClassDef classDef, Source &source ) : void

Uses the Class Definition to add the correct table name to the Source.

PrepareSource ( IClassDef classDef, Source &source, IClassDef &relatedClassDef ) : void

Prepares the Source based on the ClassDef.

Private Methods

Method Description
AddAllPropsToQuery ( IClassDef classDef, Habanero.BO.SelectQuery selectQuery ) : void
AddDiscriminatorFields ( ISelectQuery selectQuery, IClassDef classDef, Criteria &criteria ) : void
CreateInheritanceJoins ( IClassDef classDef, Source rootSource ) : void
CreateQueryField ( IClassDef classDef, IPropDef propDef ) : QueryField
PrepareSourceTree ( Source currentSource, ClassDef &currentClassDef ) : void

Method Details

CreateOrderCriteria() public static method

Based on the class definition and the orderByString an OrderCriteria object is created. The orderCriteria object is a set of order by fields including information on their business object properties and their dataSource.
public static CreateOrderCriteria ( IClassDef classDef, string orderByString ) : IOrderCriteria
classDef IClassDef The class definition to use for building the order criteria
orderByString string The orderby string to use for creating the .
return IOrderCriteria

CreateQueryField() public static method

Creates a QueryField given a classdef and a property name.
public static CreateQueryField ( IClassDef classDef, string propertyName ) : QueryField
classDef IClassDef
propertyName string
return Habanero.Base.QueryField

CreateSelectCountQuery() public static method

Creates a select query to return the count of objects in a table for that classdef
public static CreateSelectCountQuery ( IClassDef classDef ) : ISelectQuery
classDef IClassDef
return ISelectQuery

CreateSelectCountQuery() public static method

Creates a select query to return the count of objects in a table for that classdef with the criteria
public static CreateSelectCountQuery ( IClassDef classDef, Criteria criteria ) : ISelectQuery
classDef IClassDef The class def for the class that the count is being returned
criteria Criteria The Criteria for the class that the count is being returned
return ISelectQuery

CreateSelectQuery() public static method

Creates a SelectQuery using the given classdef without any Criteria. All information in the ClassDef will be taken into account (such as inheritance structures).
public static CreateSelectQuery ( IClassDef classDef ) : ISelectQuery
classDef IClassDef The to create the SelectQuery for.
return ISelectQuery

CreateSelectQuery() public static method

Creates a SelectQuery using the given classdef with the given Criteria. All information in the ClassDef will be taken into account (such as inheritance structures).
public static CreateSelectQuery ( IClassDef classDef, Criteria criteria ) : ISelectQuery
classDef IClassDef The to create the SelectQuery for.
criteria Criteria The criteria to be set on the SelectQuery
return ISelectQuery

PrepareCriteria() public static method

Based on the class definition the given Criteria object is set up with the correct entity names and field names, in preparation for using it as part of a SelectQuery that has been built using the QueryBuilder and the same ClassDef
public static PrepareCriteria ( IClassDef classDef, Criteria criteria ) : void
classDef IClassDef The class definition to use for preparing the .
criteria Criteria The to prepare for use with a .
return void

PrepareDiscriminatorCriteria() public static method

public static PrepareDiscriminatorCriteria ( IClassDef classDef, Criteria criteria ) : void
classDef IClassDef
criteria Criteria
return void

PrepareField() public static method

Prepares
public static PrepareField ( Source currentSource, IClassDef classDef, QueryField field ) : IPropDef
currentSource Source
classDef IClassDef
field Habanero.Base.QueryField
return IPropDef

PrepareSource() public static method

Uses the Class Definition to add the correct table name to the Source.
public static PrepareSource ( IClassDef classDef, Source &source ) : void
classDef IClassDef
source Source
return void

PrepareSource() public static method

Prepares the Source based on the ClassDef.
public static PrepareSource ( IClassDef classDef, Source &source, IClassDef &relatedClassDef ) : void
classDef IClassDef
source Source
relatedClassDef IClassDef
return void