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, waitgroupingIsomorphiccheckContentsCanGrouppublic ConstExpression(java.lang.Class<R> filter_type, java.lang.Class<T> target, T n)
public int add(java.lang.StringBuilder sb,
boolean qualify)
SQLValuepublic java.util.List<PatternArgument> getParameters(java.util.List<PatternArgument> list)
SQLValuegetParameters in interface SQLValue<T>list - to modifypublic T makeObject(java.sql.ResultSet rs, int pos) throws DataException, java.sql.SQLException
SQLValuemakeObject in interface SQLValue<T>rs - ResultSetDataExceptionjava.sql.SQLExceptionpublic java.lang.Class<T> getTarget()
Targettedpublic java.lang.String toString()
toString in class java.lang.Objectpublic SQLFilter getRequiredFilter()
SQLValuegetRequiredFilter in interface SQLValue<T>public T getValue(R r)
Accessorpublic T getValue()
public boolean canSet()
AccessorAccessor support setting values.public void setValue(R r, T value)
AccessorUnsupportedOperationException.public int hashCode()
hashCode in interface SQLExpression<T>hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface SQLExpression<T>equals in class java.lang.Objectpublic int addGroup(java.lang.StringBuilder sb,
boolean qualify)
GroupingSQLValueaddGroup in interface GroupingSQLValue<T>public java.util.List<PatternArgument> getGroupParameters(java.util.List<PatternArgument> list)
GroupingSQLValuegetGroupParameters in interface GroupingSQLValue<T>public SQLFilter<R> getFilter(MatchCondition match, T val) throws CannotFilterException, NoSQLFilterException
FilterProviderSQLFilter comparing against the target valuegetFilter in interface FilterProvider<R,T>SQLFilterCannotFilterExceptionNoSQLFilterExceptionpublic SQLFilter<R> getNullFilter(boolean is_null) throws CannotFilterException, NoSQLFilterException
FilterProviderSQLFilter checking if the target value is or is not null.getNullFilter in interface FilterProvider<R,T>SQLFilterCannotFilterExceptionNoSQLFilterExceptionpublic SQLFilter<R> getOrderFilter(boolean descending) throws CannotFilterException, NoSQLFilterException
FilterProviderSQLFilter 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>SQLFilterCannotFilterExceptionNoSQLFilterExceptionpublic java.lang.Class<R> getFilterType()
FilterProviderSQLFilter.getFilterType in interface FilterProvider<R,T>