org.teiid.connector.language
Interface ILanguageFactory


public interface ILanguageFactory

Factory for the construction of language objects that implement the language interfaces. This factory is provided by the connector environment and can be used in modifying the language interfaces if needed.


Method Summary
 IAggregate createAggregate(java.lang.String name, boolean isDistinct, IExpression expression, java.lang.Class type)
          Create aggregate function.
 IBulkInsert createBulkInsert(IGroup group, java.util.List<? extends IElement> columns, java.util.List<java.util.List<java.lang.Object>> rows)
          Create new bulk insert command
 ICompareCriteria createCompareCriteria(ICompareCriteria.Operator operator, IExpression leftExpression, IExpression rightExpression)
          Create compare criteria.
 ICompoundCriteria createCompoundCriteria(ICompoundCriteria.Operator operator, java.util.List<? extends ICriteria> innerCriteria)
          Create a new ICompoundCriteria
 IDelete createDelete(IGroup group, ICriteria criteria)
          Create a new IDelete.
 IElement createElement(java.lang.String name, IGroup group, Element metadataReference, java.lang.Class type)
          Create new element.
 IExistsCriteria createExistsCriteria(IQuery query)
          Create new exists criteria.
 IFrom createFrom(java.util.List<? extends IFromItem> items)
          Create new from clause
 IFunction createFunction(java.lang.String functionName, IExpression[] args, java.lang.Class type)
          Create new function
 IFunction createFunction(java.lang.String functionName, java.util.List<? extends IExpression> args, java.lang.Class type)
          Create new function
 IGroup createGroup(java.lang.String context, java.lang.String definition, Group metadataReference)
          Create new group.
 IGroupBy createGroupBy(java.util.List<? extends IExpression> items)
          Create new group by.
 IInCriteria createInCriteria(IExpression leftExpression, java.util.List<? extends IExpression> rightExpressions, boolean isNegated)
          Create new IN criteria
 IInlineView createInlineView(IQueryCommand query, java.lang.String name)
          Create new inline view
 IInsert createInsert(IGroup group, java.util.List<IElement> columns, java.util.List<? extends IExpression> values)
          Create new insert command
 IIsNullCriteria createIsNullCriteria(IExpression expression, boolean isNegated)
          Create new IS NULL criteria
 IJoin createJoin(IJoin.JoinType joinType, IFromItem leftItem, IFromItem rightItem, java.util.List<? extends ICriteria> criteria)
          Create new join predicate
 ILikeCriteria createLikeCriteria(IExpression leftExpression, IExpression rightExpression, java.lang.Character escapeCharacter, boolean isNegated)
          Create new LIKE criteria
 ILiteral createLiteral(java.lang.Object value, java.lang.Class type)
          Create new literal value.
 INotCriteria createNotCriteria(ICriteria criteria)
          Create new NOT criteria
 IOrderBy createOrderBy(java.util.List<? extends IOrderByItem> items)
          Create new ORDER BY clause
 IOrderByItem createOrderByItem(java.lang.String name, IElement element, boolean direction)
          Create new ORDER BY item
 IParameter createParameter(int index, IParameter.Direction direction, java.lang.Object value, java.lang.Class type, Parameter metadataReference)
          Create new procedure parameter
 IProcedure createProcedure(java.lang.String name, java.util.List<? extends IParameter> parameters, Procedure metadataReference)
          Create new procedure
 IQuery createQuery(ISelect select, IFrom from, ICriteria where, IGroupBy groupBy, ICriteria having, IOrderBy orderBy)
          Create new query
 IScalarSubquery createScalarSubquery(IQuery query)
          Create new scalar subquery which can be used as an expression
 ISearchedCaseExpression createSearchedCaseExpression(java.util.List<? extends ICriteria> whenExpressions, java.util.List<? extends IExpression> thenExpressions, IExpression elseExpression, java.lang.Class type)
          Create searched case expression.
 ISelect createSelect(boolean isDistinct, java.util.List<? extends ISelectSymbol> selectSymbols)
          Create new SELECT clause
 ISelectSymbol createSelectSymbol(java.lang.String name, IExpression expression)
          Create new select symbol
 ISetClause createSetClause(IElement symbol, IExpression value)
          Creates a new SetClause
 ISetClauseList createSetClauseList(java.util.List<ISetClause> clauses)
          Creates a new SetClauseList
 ISetQuery createSetOp(ISetQuery.Operation operation, boolean all, IQueryCommand leftQuery, IQueryCommand rightQuery, IOrderBy orderBy, ILimit limit)
           
 ISubqueryCompareCriteria createSubqueryCompareCriteria(IExpression leftExpression, ICompareCriteria.Operator operator, ISubqueryCompareCriteria.Quantifier quantifier, IQuery subquery)
          Create new subquery compare criteria
 ISubqueryInCriteria createSubqueryInCriteria(IExpression expression, IQuery subquery, boolean isNegated)
          Create new subquery IN criteria
 IUpdate createUpdate(IGroup group, ISetClauseList updates, ICriteria criteria)
          Create new UPDATE command
 

Method Detail

createAggregate

IAggregate createAggregate(java.lang.String name,
                           boolean isDistinct,
                           IExpression expression,
                           java.lang.Class type)
Create aggregate function.

Parameters:
name - Aggregate function name, as defined by constants in IAggregate
isDistinct - True if aggregate function is DISTINCT, false otherwise
expression - Inner expression of the aggregate function
type - Data type
Returns:
New IAggregate

createCompareCriteria

ICompareCriteria createCompareCriteria(ICompareCriteria.Operator operator,
                                       IExpression leftExpression,
                                       IExpression rightExpression)
Create compare criteria.

Parameters:
operator - Operator, as defined in constants in ICompareCriteria
leftExpression - Left expression
rightExpression - Right expression
Returns:
New ICompareCriteria

createCompoundCriteria

ICompoundCriteria createCompoundCriteria(ICompoundCriteria.Operator operator,
                                         java.util.List<? extends ICriteria> innerCriteria)
Create a new ICompoundCriteria

Parameters:
operator - Operator, as defined by ICompoundCriteria.Operator.AND or ICompoundCriteria.Operator.OR
innerCriteria - List of ICriteria, typically containing two criteria
Returns:
New ICompoundCriteria

createDelete

IDelete createDelete(IGroup group,
                     ICriteria criteria)
Create a new IDelete.

Parameters:
group - The group to delete from
criteria - The criteria (can be null)
Returns:
New IDelete

createElement

IElement createElement(java.lang.String name,
                       IGroup group,
                       Element metadataReference,
                       java.lang.Class type)
Create new element.

Parameters:
name - Name of the element
group - Group this element is in
metadataReference - Metadata reference describing this element
type - Data type
Returns:
New IElement

createExistsCriteria

IExistsCriteria createExistsCriteria(IQuery query)
Create new exists criteria.

Parameters:
query - Inner query
Returns:
New IExists

createFrom

IFrom createFrom(java.util.List<? extends IFromItem> items)
Create new from clause

Parameters:
items - List of IFromItem
Returns:
New IFrom

createFunction

IFunction createFunction(java.lang.String functionName,
                         IExpression[] args,
                         java.lang.Class type)
Create new function

Parameters:
functionName - Name of the function
args - Arguments, should never be null
type - Data type returned
Returns:
New IFunction

createFunction

IFunction createFunction(java.lang.String functionName,
                         java.util.List<? extends IExpression> args,
                         java.lang.Class type)
Create new function

Parameters:
functionName - Name of the function
args - Arguments, should never be null
type - Data type returned
Returns:
New IFunction

createGroup

IGroup createGroup(java.lang.String context,
                   java.lang.String definition,
                   Group metadataReference)
Create new group.

Parameters:
context - Alias if it exists, or group name if no alias exists
definition - Group name
metadataReference - Reference to metadata identifier
Returns:
New IGroup

createGroupBy

IGroupBy createGroupBy(java.util.List<? extends IExpression> items)
Create new group by.

Parameters:
items - List of IGroupByItem
Returns:
New IGroupBy

createInCriteria

IInCriteria createInCriteria(IExpression leftExpression,
                             java.util.List<? extends IExpression> rightExpressions,
                             boolean isNegated)
Create new IN criteria

Parameters:
leftExpression - Left expression
rightExpressions - List of right expressions
isNegated - True if NOT IN, false for IN
Returns:
New IInCriteria

createInlineView

IInlineView createInlineView(IQueryCommand query,
                             java.lang.String name)
Create new inline view

Parameters:
query - The query defining the inline view
name - The name of the inline view
Returns:
New IInLineView

createInsert

IInsert createInsert(IGroup group,
                     java.util.List<IElement> columns,
                     java.util.List<? extends IExpression> values)
Create new insert command

Parameters:
group - Insert group
columns - List of IElement being inserted into
values - List of IExpression (usually ILiteral)
Returns:
New IInsert

createBulkInsert

IBulkInsert createBulkInsert(IGroup group,
                             java.util.List<? extends IElement> columns,
                             java.util.List<java.util.List<java.lang.Object>> rows)
Create new bulk insert command

Parameters:
group - Insert group
columns - List of IElement being inserted into
List - of Lists containing the actual values
Returns:
New IBulkInsert

createIsNullCriteria

IIsNullCriteria createIsNullCriteria(IExpression expression,
                                     boolean isNegated)
Create new IS NULL criteria

Parameters:
expression - Expression
isNegated - True if IS NOT NULL, false if IS NULL
Returns:
New IIsNullCriteria

createJoin

IJoin createJoin(IJoin.JoinType joinType,
                 IFromItem leftItem,
                 IFromItem rightItem,
                 java.util.List<? extends ICriteria> criteria)
Create new join predicate

Parameters:
joinType - Join type as defined by constants in IJoin
leftItem - Left from clause item
rightItem - Right from clause item
criteria - List of ICriteria (considered to be AND'ed together)
Returns:
New IJoin

createLikeCriteria

ILikeCriteria createLikeCriteria(IExpression leftExpression,
                                 IExpression rightExpression,
                                 java.lang.Character escapeCharacter,
                                 boolean isNegated)
Create new LIKE criteria

Parameters:
leftExpression - Left expression
rightExpression - Right expression
escapeCharacter - Escape character or null if none
isNegated - True if NOT LIKE, false if LIKE
Returns:
New ILikeCriteria

createLiteral

ILiteral createLiteral(java.lang.Object value,
                       java.lang.Class type)
Create new literal value.

Parameters:
value - The value, may be null
type - The data type
Returns:
New ILiteral

createNotCriteria

INotCriteria createNotCriteria(ICriteria criteria)
Create new NOT criteria

Parameters:
criteria - Inner criteria
Returns:
New INotCriteria

createOrderBy

IOrderBy createOrderBy(java.util.List<? extends IOrderByItem> items)
Create new ORDER BY clause

Parameters:
items - List of IOrderByItem
Returns:
New IOrderBy

createOrderByItem

IOrderByItem createOrderByItem(java.lang.String name,
                               IElement element,
                               boolean direction)
Create new ORDER BY item

Parameters:
name - Name of item
element - Associated element, if applicable
direction - Direction, defined by constants in IOrderByItem
Returns:
New IOrderByItem

createParameter

IParameter createParameter(int index,
                           IParameter.Direction direction,
                           java.lang.Object value,
                           java.lang.Class type,
                           Parameter metadataReference)
Create new procedure parameter

Parameters:
index - Index in the procedure call
direction - Kind of parameter - IN, OUT, .... as defined in IParameter
value - Value, may be null if not applicable
type - Data type
metadataReference - Metadata identifier reference
Returns:
New IParameter

createProcedure

IProcedure createProcedure(java.lang.String name,
                           java.util.List<? extends IParameter> parameters,
                           Procedure metadataReference)
Create new procedure

Parameters:
name - Name of procedure
parameters - List of IParameter
metadataReference - Metadata identifier reference
Returns:
New IProcedure

createQuery

IQuery createQuery(ISelect select,
                   IFrom from,
                   ICriteria where,
                   IGroupBy groupBy,
                   ICriteria having,
                   IOrderBy orderBy)
Create new query

Parameters:
select - SELECT clause
from - FROM clause
where - WHERE clause
groupBy - GROUP BY clause
having - HAVING clause
orderBy - ORDER BY clause
Returns:
New IQuery

createSetOp

ISetQuery createSetOp(ISetQuery.Operation operation,
                      boolean all,
                      IQueryCommand leftQuery,
                      IQueryCommand rightQuery,
                      IOrderBy orderBy,
                      ILimit limit)

createScalarSubquery

IScalarSubquery createScalarSubquery(IQuery query)
Create new scalar subquery which can be used as an expression

Parameters:
query - Subquery
Returns:
New scalar subquery

createSearchedCaseExpression

ISearchedCaseExpression createSearchedCaseExpression(java.util.List<? extends ICriteria> whenExpressions,
                                                     java.util.List<? extends IExpression> thenExpressions,
                                                     IExpression elseExpression,
                                                     java.lang.Class type)
Create searched case expression.

Parameters:
whenExpressions - List of when expressions, should match thenExpressions
thenExpressions - List of then expressions, should match whenExpressions
elseExpression - Else expression, may be null
type - Data type
Returns:
New ICaseExpression

createSelect

ISelect createSelect(boolean isDistinct,
                     java.util.List<? extends ISelectSymbol> selectSymbols)
Create new SELECT clause

Parameters:
isDistinct - True if DISTINCT, false for ALL
selectSymbols - List of ISelectSymbol
Returns:
New ISelect

createSelectSymbol

ISelectSymbol createSelectSymbol(java.lang.String name,
                                 IExpression expression)
Create new select symbol

Parameters:
name - Name of the symbol (which may be an alias)
expression - Expression
Returns:
New ISelectSymbol

createSubqueryCompareCriteria

ISubqueryCompareCriteria createSubqueryCompareCriteria(IExpression leftExpression,
                                                       ICompareCriteria.Operator operator,
                                                       ISubqueryCompareCriteria.Quantifier quantifier,
                                                       IQuery subquery)
Create new subquery compare criteria

Parameters:
leftExpression - Left expression
operator - Comparison operator, as defined in ISubqueryCompareCriteria
quantifier - Quantification operator, as defined in ISubqueryCompareCriteria
subquery - Right subquery
Returns:
New ISubqueryCompareCriteria

createSubqueryInCriteria

ISubqueryInCriteria createSubqueryInCriteria(IExpression expression,
                                             IQuery subquery,
                                             boolean isNegated)
Create new subquery IN criteria

Parameters:
expression - Left expression
subquery - Right subquery
isNegated - True if NOT IN, false if IN
Returns:
New ISubqueryInCriteria

createUpdate

IUpdate createUpdate(IGroup group,
                     ISetClauseList updates,
                     ICriteria criteria)
Create new UPDATE command

Parameters:
group - Group being updated
updates -
criteria - Criteria to use, may be null
Returns:
New IUpdate

createSetClauseList

ISetClauseList createSetClauseList(java.util.List<ISetClause> clauses)
Creates a new SetClauseList

Parameters:
clauses -
Returns:

createSetClause

ISetClause createSetClause(IElement symbol,
                           IExpression value)
Creates a new SetClause

Parameters:
symbol -
value -
Returns:


Copyright © 2009. All Rights Reserved.