T
- type of constantR
- type of target objectpublic final class ConstExpression<T,R> extends java.lang.Object implements SQLExpression<T>, SQLAccessor<T,R>, GroupingSQLValue<T>, FilterProvider<R,T>
SQLAccessor
Constructor and Description |
---|
ConstExpression(java.lang.Class<R> filter_type,
java.lang.Class<T> target,
T n) |
ConstExpression(java.lang.Class<R> filter_type,
java.lang.Class<T> target,
T n,
boolean log) |
ConstExpression(java.lang.Class<T> target,
T n) |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.StringBuilder sb,
boolean qualify)
Add the expression to a StringBuilder
|
int |
addGroup(java.lang.StringBuilder sb,
boolean qualify)
Add the group-by clause to a query.
|
boolean |
canSet()
does this
Accessor support setting values. |
boolean |
equals(java.lang.Object obj) |
SQLFilter<R> |
getFilter(MatchCondition match,
T val)
Create a
SQLFilter comparing against the target value |
java.lang.Class<R> |
getFilterType()
get the type bounds on the produced
SQLFilter . |
java.util.List<PatternArgument> |
getGroupParameters(java.util.List<PatternArgument> list)
Get the parameters for a group-by clause.
|
SQLFilter<R> |
getNullFilter(boolean is_null)
create a
SQLFilter checking if the target value is or is not null. |
SQLFilter<R> |
getOrderFilter(boolean descending)
create a
SQLFilter that orders results by the target value. |
java.util.List<PatternArgument> |
getParameters(java.util.List<PatternArgument> list)
Add parameters for this value to a list.
|
SQLFilter |
getRequiredFilter()
Get an SQLFilter required to be added to the filter set.
|
java.lang.Class<T> |
getTarget()
Get the type of the returned object as far as it is known.
|
T |
getValue() |
T |
getValue(R r)
get the value from the target object
|
int |
hashCode() |
T |
makeObject(java.sql.ResultSet rs,
int pos)
Extract a result of the expression from a ResultSet into an object of the specified type.
|
void |
setValue(R r,
T value)
Set value if supported otherwise throw a
UnsupportedOperationException . |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
groupingIsomorphic
checkContentsCanGroup
public ConstExpression(java.lang.Class<R> filter_type, java.lang.Class<T> target, T n)
public int add(java.lang.StringBuilder sb, boolean qualify)
SQLValue
public java.util.List<PatternArgument> getParameters(java.util.List<PatternArgument> list)
SQLValue
getParameters
in interface SQLValue<T>
list
- to modifypublic T makeObject(java.sql.ResultSet rs, int pos) throws DataException, java.sql.SQLException
SQLValue
makeObject
in interface SQLValue<T>
rs
- ResultSetDataException
java.sql.SQLException
public java.lang.Class<T> getTarget()
Targetted
public java.lang.String toString()
toString
in class java.lang.Object
public SQLFilter getRequiredFilter()
SQLValue
getRequiredFilter
in interface SQLValue<T>
public T getValue(R r)
Accessor
public T getValue()
public boolean canSet()
Accessor
Accessor
support setting values.public void setValue(R r, T value)
Accessor
UnsupportedOperationException
.public int hashCode()
hashCode
in interface SQLExpression<T>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface SQLExpression<T>
equals
in class java.lang.Object
public int addGroup(java.lang.StringBuilder sb, boolean qualify)
GroupingSQLValue
addGroup
in interface GroupingSQLValue<T>
public java.util.List<PatternArgument> getGroupParameters(java.util.List<PatternArgument> list)
GroupingSQLValue
getGroupParameters
in interface GroupingSQLValue<T>
public SQLFilter<R> getFilter(MatchCondition match, T val) throws CannotFilterException, NoSQLFilterException
FilterProvider
SQLFilter
comparing against the target valuegetFilter
in interface FilterProvider<R,T>
SQLFilter
CannotFilterException
NoSQLFilterException
public SQLFilter<R> getNullFilter(boolean is_null) throws CannotFilterException, NoSQLFilterException
FilterProvider
SQLFilter
checking if the target value is or is not null.getNullFilter
in interface FilterProvider<R,T>
SQLFilter
CannotFilterException
NoSQLFilterException
public SQLFilter<R> getOrderFilter(boolean descending) throws CannotFilterException, NoSQLFilterException
FilterProvider
SQLFilter
that orders results by the target value. This may involve joins so
may not be just an OrderFilter
though it will contain one.getOrderFilter
in interface FilterProvider<R,T>
SQLFilter
CannotFilterException
NoSQLFilterException
public java.lang.Class<R> getFilterType()
FilterProvider
SQLFilter
.getFilterType
in interface FilterProvider<R,T>