org.apache.openjpa.jdbc.kernel.exps
Class JDBCExpressionFactory
java.lang.Object
org.apache.openjpa.jdbc.kernel.exps.JDBCExpressionFactory
- All Implemented Interfaces:
- Serializable, ExpressionFactory
public class JDBCExpressionFactory
- extends Object
- implements ExpressionFactory, Serializable
Expression factory implementation that can be used to execute queries
via SQL.
- Author:
- Abe White
- See Also:
- Serialized Form
Method Summary |
Value |
abs(Value val)
|
Value |
add(Value v1,
Value v2)
|
Value |
all(Value val)
|
Expression |
and(Expression exp1,
Expression exp2)
|
Value |
any(Value val)
|
Expression |
asExpression(Value v)
|
Value |
avg(Value val)
|
Expression |
bindKeyVariable(Value var,
Value val)
|
Expression |
bindValueVariable(Value var,
Value val)
|
Expression |
bindVariable(Value var,
Value val)
|
Value |
cast(Value val,
Class cls)
|
Value |
concat(Value v1,
Value v2)
|
Expression |
contains(Value map,
Value arg)
|
Expression |
containsKey(Value map,
Value arg)
|
Expression |
containsValue(Value map,
Value arg)
|
Value |
count(Value val)
|
Value |
distinct(Value val)
|
Value |
divide(Value v1,
Value v2)
|
Expression |
emptyExpression()
|
Expression |
endsWith(Value v1,
Value v2)
|
Expression |
equal(Value v1,
Value v2)
|
Value |
getCurrentDate()
|
Value |
getCurrentTime()
|
Value |
getCurrentTimestamp()
|
Value |
getMapValue(Value map,
Value arg)
|
Value |
getNull()
|
Value |
getObjectId(Value val)
|
SelectConstructor |
getSelectConstructor()
Use to create SQL select. |
Value |
getThis()
|
Expression |
greaterThan(Value v1,
Value v2)
|
Expression |
greaterThanEqual(Value v1,
Value v2)
|
Value |
indexOf(Value v1,
Value v2)
|
Expression |
isEmpty(Value val)
|
Expression |
isInstance(Value val,
Class c)
|
Expression |
isNotEmpty(Value val)
|
Expression |
lessThan(Value v1,
Value v2)
|
Expression |
lessThanEqual(Value v1,
Value v2)
|
Expression |
matches(Value v1,
Value v2,
String single,
String multi,
String esc)
|
Value |
max(Value val)
|
Value |
min(Value val)
|
Value |
mod(Value v1,
Value v2)
|
Value |
multiply(Value v1,
Value v2)
|
Value |
newAggregate(AggregateListener listener,
Value arg)
|
Arguments |
newArgumentList(Value v1,
Value v2)
|
Value |
newBoundVariable(String name,
Class type)
|
Value |
newExtension(FilterListener listener,
Value target,
Value arg)
|
Literal |
newLiteral(Object val,
int ptype)
|
Parameter |
newParameter(String name,
Class type)
|
Path |
newPath()
|
Path |
newPath(Value val)
|
Subquery |
newSubquery(ClassMetaData candidate,
boolean subs,
String alias)
|
Value |
newUnboundVariable(String name,
Class type)
|
Expression |
not(Expression exp)
|
Expression |
notEqual(Value v1,
Value v2)
|
Expression |
notMatches(Value v1,
Value v2,
String single,
String multi,
String esc)
|
Expression |
or(Expression exp1,
Expression exp2)
|
Value |
size(Value val)
|
Value |
sqrt(Value val)
|
Expression |
startsWith(Value v1,
Value v2)
|
Value |
stringLength(Value str)
|
Value |
substring(Value v1,
Value v2)
|
Value |
subtract(Value v1,
Value v2)
|
Value |
sum(Value val)
|
Value |
toLowerCase(Value val)
|
Value |
toUpperCase(Value val)
|
Value |
trim(Value str,
Value trimChar,
Boolean where)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDBCExpressionFactory
public JDBCExpressionFactory(ClassMapping type)
- Constructor. Supply the type we're querying against.
getSelectConstructor
public SelectConstructor getSelectConstructor()
- Use to create SQL select.
emptyExpression
public Expression emptyExpression()
- Specified by:
emptyExpression
in interface ExpressionFactory
asExpression
public Expression asExpression(Value v)
- Specified by:
asExpression
in interface ExpressionFactory
equal
public Expression equal(Value v1,
Value v2)
- Specified by:
equal
in interface ExpressionFactory
notEqual
public Expression notEqual(Value v1,
Value v2)
- Specified by:
notEqual
in interface ExpressionFactory
lessThan
public Expression lessThan(Value v1,
Value v2)
- Specified by:
lessThan
in interface ExpressionFactory
greaterThan
public Expression greaterThan(Value v1,
Value v2)
- Specified by:
greaterThan
in interface ExpressionFactory
lessThanEqual
public Expression lessThanEqual(Value v1,
Value v2)
- Specified by:
lessThanEqual
in interface ExpressionFactory
greaterThanEqual
public Expression greaterThanEqual(Value v1,
Value v2)
- Specified by:
greaterThanEqual
in interface ExpressionFactory
isEmpty
public Expression isEmpty(Value val)
- Specified by:
isEmpty
in interface ExpressionFactory
isNotEmpty
public Expression isNotEmpty(Value val)
- Specified by:
isNotEmpty
in interface ExpressionFactory
contains
public Expression contains(Value map,
Value arg)
- Specified by:
contains
in interface ExpressionFactory
containsKey
public Expression containsKey(Value map,
Value arg)
- Specified by:
containsKey
in interface ExpressionFactory
containsValue
public Expression containsValue(Value map,
Value arg)
- Specified by:
containsValue
in interface ExpressionFactory
isInstance
public Expression isInstance(Value val,
Class c)
- Specified by:
isInstance
in interface ExpressionFactory
and
public Expression and(Expression exp1,
Expression exp2)
- Specified by:
and
in interface ExpressionFactory
or
public Expression or(Expression exp1,
Expression exp2)
- Specified by:
or
in interface ExpressionFactory
not
public Expression not(Expression exp)
- Specified by:
not
in interface ExpressionFactory
bindVariable
public Expression bindVariable(Value var,
Value val)
- Specified by:
bindVariable
in interface ExpressionFactory
bindKeyVariable
public Expression bindKeyVariable(Value var,
Value val)
- Specified by:
bindKeyVariable
in interface ExpressionFactory
bindValueVariable
public Expression bindValueVariable(Value var,
Value val)
- Specified by:
bindValueVariable
in interface ExpressionFactory
startsWith
public Expression startsWith(Value v1,
Value v2)
- Specified by:
startsWith
in interface ExpressionFactory
endsWith
public Expression endsWith(Value v1,
Value v2)
- Specified by:
endsWith
in interface ExpressionFactory
notMatches
public Expression notMatches(Value v1,
Value v2,
String single,
String multi,
String esc)
- Specified by:
notMatches
in interface ExpressionFactory
matches
public Expression matches(Value v1,
Value v2,
String single,
String multi,
String esc)
- Specified by:
matches
in interface ExpressionFactory
newSubquery
public Subquery newSubquery(ClassMetaData candidate,
boolean subs,
String alias)
- Specified by:
newSubquery
in interface ExpressionFactory
newPath
public Path newPath()
- Specified by:
newPath
in interface ExpressionFactory
newPath
public Path newPath(Value val)
- Specified by:
newPath
in interface ExpressionFactory
newLiteral
public Literal newLiteral(Object val,
int ptype)
- Specified by:
newLiteral
in interface ExpressionFactory
getThis
public Value getThis()
- Specified by:
getThis
in interface ExpressionFactory
getNull
public Value getNull()
- Specified by:
getNull
in interface ExpressionFactory
getCurrentDate
public Value getCurrentDate()
- Specified by:
getCurrentDate
in interface ExpressionFactory
getCurrentTime
public Value getCurrentTime()
- Specified by:
getCurrentTime
in interface ExpressionFactory
getCurrentTimestamp
public Value getCurrentTimestamp()
- Specified by:
getCurrentTimestamp
in interface ExpressionFactory
newParameter
public Parameter newParameter(String name,
Class type)
- Specified by:
newParameter
in interface ExpressionFactory
newExtension
public Value newExtension(FilterListener listener,
Value target,
Value arg)
- Specified by:
newExtension
in interface ExpressionFactory
newAggregate
public Value newAggregate(AggregateListener listener,
Value arg)
- Specified by:
newAggregate
in interface ExpressionFactory
newArgumentList
public Arguments newArgumentList(Value v1,
Value v2)
- Specified by:
newArgumentList
in interface ExpressionFactory
newUnboundVariable
public Value newUnboundVariable(String name,
Class type)
- Specified by:
newUnboundVariable
in interface ExpressionFactory
newBoundVariable
public Value newBoundVariable(String name,
Class type)
- Specified by:
newBoundVariable
in interface ExpressionFactory
cast
public Value cast(Value val,
Class cls)
- Specified by:
cast
in interface ExpressionFactory
add
public Value add(Value v1,
Value v2)
- Specified by:
add
in interface ExpressionFactory
subtract
public Value subtract(Value v1,
Value v2)
- Specified by:
subtract
in interface ExpressionFactory
multiply
public Value multiply(Value v1,
Value v2)
- Specified by:
multiply
in interface ExpressionFactory
divide
public Value divide(Value v1,
Value v2)
- Specified by:
divide
in interface ExpressionFactory
mod
public Value mod(Value v1,
Value v2)
- Specified by:
mod
in interface ExpressionFactory
abs
public Value abs(Value val)
- Specified by:
abs
in interface ExpressionFactory
indexOf
public Value indexOf(Value v1,
Value v2)
- Specified by:
indexOf
in interface ExpressionFactory
concat
public Value concat(Value v1,
Value v2)
- Specified by:
concat
in interface ExpressionFactory
stringLength
public Value stringLength(Value str)
- Specified by:
stringLength
in interface ExpressionFactory
trim
public Value trim(Value str,
Value trimChar,
Boolean where)
- Specified by:
trim
in interface ExpressionFactory
sqrt
public Value sqrt(Value val)
- Specified by:
sqrt
in interface ExpressionFactory
substring
public Value substring(Value v1,
Value v2)
- Specified by:
substring
in interface ExpressionFactory
toUpperCase
public Value toUpperCase(Value val)
- Specified by:
toUpperCase
in interface ExpressionFactory
toLowerCase
public Value toLowerCase(Value val)
- Specified by:
toLowerCase
in interface ExpressionFactory
avg
public Value avg(Value val)
- Specified by:
avg
in interface ExpressionFactory
count
public Value count(Value val)
- Specified by:
count
in interface ExpressionFactory
distinct
public Value distinct(Value val)
- Specified by:
distinct
in interface ExpressionFactory
max
public Value max(Value val)
- Specified by:
max
in interface ExpressionFactory
min
public Value min(Value val)
- Specified by:
min
in interface ExpressionFactory
sum
public Value sum(Value val)
- Specified by:
sum
in interface ExpressionFactory
any
public Value any(Value val)
- Specified by:
any
in interface ExpressionFactory
all
public Value all(Value val)
- Specified by:
all
in interface ExpressionFactory
size
public Value size(Value val)
- Specified by:
size
in interface ExpressionFactory
getObjectId
public Value getObjectId(Value val)
- Specified by:
getObjectId
in interface ExpressionFactory
getMapValue
public Value getMapValue(Value map,
Value arg)
- Specified by:
getMapValue
in interface ExpressionFactory
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.