public class SQLExpressionFactory extends Object
Constructor and Description |
---|
SQLExpressionFactory(RDBMSStoreManager storeMgr)
Constructor for an SQLExpressionFactory.
|
Modifier and Type | Method and Description |
---|---|
JavaTypeMapping |
getMappingForType(Class cls,
boolean useCached)
Accessor for a mapping to use in a query expression.
|
SQLMethod |
getMethod(String className,
String methodName,
List args)
Accessor for the method defined by the class/method names and supplied args.
|
SQLExpression |
invokeMethod(SQLStatement stmt,
String className,
String methodName,
SQLExpression expr,
List args)
Accessor for the result of a method call on the supplied expression with the supplied args.
|
SQLExpression |
invokeOperation(String name,
SQLExpression expr,
SQLExpression expr2)
Accessor for the result of an operation call on the supplied expression with the supplied args.
|
boolean |
isMethodRegistered(String className,
String methodName) |
SQLExpression |
newExpression(SQLStatement stmt,
SQLTable sqlTbl,
JavaTypeMapping mapping)
Factory for an expression representing a mapping on a table.
|
SQLExpression |
newExpression(SQLStatement stmt,
SQLTable sqlTbl,
JavaTypeMapping mapping,
JavaTypeMapping parentMapping)
Factory for an expression representing a mapping on a table.
|
SQLExpression |
newLiteral(SQLStatement stmt,
JavaTypeMapping mapping,
Object value)
Factory for a literal representing a value.
|
SQLExpression |
newLiteralParameter(SQLStatement stmt,
JavaTypeMapping mapping,
Object value,
String paramName)
Factory for a literal as an input parameter.
|
void |
registerMethod(String className,
String methodName,
SQLMethod method,
boolean datastoreDependent)
Method to allow a user to register an SQLMethod at runtime without utilising the plugin mechanism.
|
public SQLExpressionFactory(RDBMSStoreManager storeMgr)
storeMgr
- RDBMS Managerpublic SQLExpression newExpression(SQLStatement stmt, SQLTable sqlTbl, JavaTypeMapping mapping)
stmt
- The statementsqlTbl
- The tablemapping
- The mappingpublic SQLExpression newExpression(SQLStatement stmt, SQLTable sqlTbl, JavaTypeMapping mapping, JavaTypeMapping parentMapping)
stmt
- The statementsqlTbl
- The tablemapping
- The mappingparentMapping
- Optional parent mapping of this mapping (e.g when handling impl of an interface)public SQLExpression newLiteral(SQLStatement stmt, JavaTypeMapping mapping, Object value)
stmt
- The statementmapping
- The mappingvalue
- The valuepublic SQLExpression newLiteralParameter(SQLStatement stmt, JavaTypeMapping mapping, Object value, String paramName)
stmt
- The statementmapping
- The mappingvalue
- Value of the literal (if known)paramName
- The parameter namepublic SQLExpression invokeMethod(SQLStatement stmt, String className, String methodName, SQLExpression expr, List args)
stmt
- SQLStatement that this relates toclassName
- Class we are invoking the method onmethodName
- Name of the methodexpr
- The expression we invoke the method onargs
- Any arguments to the method callpublic void registerMethod(String className, String methodName, SQLMethod method, boolean datastoreDependent)
className
- Class name (or null if "static")methodName
- Name of the method/functionmethod
- The SQLMethod to invoke when this method is encountereddatastoreDependent
- Whether the usage of this method is datastore dependent (true means just for the current datastore, false means for all)public SQLMethod getMethod(String className, String methodName, List args)
className
- Class we are invoking the method onmethodName
- Name of the methodargs
- Any arguments to the method call (ignored currently) TODO Check the argumentspublic SQLExpression invokeOperation(String name, SQLExpression expr, SQLExpression expr2)
name
- Operation to be invokedexpr
- The first expression to perform the operation onexpr2
- The second expression to perform the operation onUnsupportedOperationException
- if the operation is not specifiedpublic JavaTypeMapping getMappingForType(Class cls, boolean useCached)
cls
- The class that the mapping should represent.useCached
- Whether to use any cached mapping (if available)Copyright © 2017. All rights reserved.