T
- Type of owning/home table.I
- Type of remote tablepublic class ConstIndexedSQLValue<T extends DataObject,I extends DataObject> extends java.lang.Object implements IndexedSQLValue<T,I>, GroupingSQLValue<IndexedReference>
IndexedSQLValue
that resolves to a constant value.
It adds the id of the reference to the SQL statement. This is therefore illegal in a GROUP BY clause
so the class implements GroupingSQLValue
.SQLGroupMapper
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Constructor and Description |
---|
ConstIndexedSQLValue(AppContext conn,
java.lang.Class<T> clazz,
IndexedReference<I> val) |
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 |
equals(java.lang.Object obj) |
DataObjectFactory<I> |
getFactory()
get the remote
DataObjectFactory |
SQLFilter<T> |
getFilter(MatchCondition match,
IndexedReference val)
Create a
SQLFilter comparing against the target value |
java.lang.Class<T> |
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.
|
SQLExpression<java.lang.Integer> |
getIDExpression()
Get a Integer valued
SQLExpression for the id of the referenced value. |
SQLFilter<T> |
getNullFilter(boolean is_null)
create a
SQLFilter checking if the target value is or is not null. |
SQLFilter<T> |
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.
|
SQLFilter<T> |
getSQLFilter(SQLFilter<I> fil)
Create a filter for the home table out of a a filter on the target object.
|
java.lang.Class<IndexedReference> |
getTarget()
Get the type of the returned object as far as it is known.
|
boolean |
groupingIsomorphic()
Is there always a one-to-one mapping between groups and values
|
int |
hashCode() |
IndexedReference<I> |
makeObject(java.sql.ResultSet rs,
int pos)
Extract a result of the expression from a ResultSet into an object of the specified type.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
checkContentsCanGroup
public ConstIndexedSQLValue(AppContext conn, java.lang.Class<T> clazz, IndexedReference<I> val)
public int add(java.lang.StringBuilder sb, boolean qualify)
SQLValue
add
in interface SQLValue<IndexedReference>
sb
- StringBuilder to modifyqualify
- boolean should fields be qualified with the table namepublic java.util.List<PatternArgument> getParameters(java.util.List<PatternArgument> list)
SQLValue
getParameters
in interface SQLValue<IndexedReference>
list
- to modifypublic IndexedReference<I> makeObject(java.sql.ResultSet rs, int pos) throws DataException
SQLValue
makeObject
in interface SQLValue<IndexedReference>
rs
- ResultSetDataException
public SQLFilter getRequiredFilter()
SQLValue
getRequiredFilter
in interface SQLValue<IndexedReference>
public java.lang.Class<IndexedReference> getTarget()
Targetted
getTarget
in interface Targetted<IndexedReference>
public SQLFilter<T> getFilter(MatchCondition match, IndexedReference val) throws CannotFilterException, NoSQLFilterException
FilterProvider
SQLFilter
comparing against the target valuegetFilter
in interface FilterProvider<T extends DataObject,IndexedReference>
SQLFilter
CannotFilterException
NoSQLFilterException
public SQLFilter<T> getNullFilter(boolean is_null) throws CannotFilterException, NoSQLFilterException
FilterProvider
SQLFilter
checking if the target value is or is not null.getNullFilter
in interface FilterProvider<T extends DataObject,IndexedReference>
SQLFilter
CannotFilterException
NoSQLFilterException
public SQLFilter<T> 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<T extends DataObject,IndexedReference>
SQLFilter
CannotFilterException
NoSQLFilterException
public java.lang.Class<T> getFilterType()
FilterProvider
SQLFilter
.getFilterType
in interface FilterProvider<T extends DataObject,IndexedReference>
public SQLFilter<T> getSQLFilter(SQLFilter<I> fil) throws CannotFilterException
IndexedSQLValue
getSQLFilter
in interface IndexedSQLValue<T extends DataObject,I extends DataObject>
SQLFilter
CannotFilterException
public DataObjectFactory<I> getFactory() throws java.lang.Exception
IndexedSQLValue
DataObjectFactory
getFactory
in interface IndexedSQLValue<T extends DataObject,I extends DataObject>
DataObjectFactory
java.lang.Exception
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int addGroup(java.lang.StringBuilder sb, boolean qualify)
GroupingSQLValue
addGroup
in interface GroupingSQLValue<IndexedReference>
public java.util.List<PatternArgument> getGroupParameters(java.util.List<PatternArgument> list)
GroupingSQLValue
getGroupParameters
in interface GroupingSQLValue<IndexedReference>
public final boolean groupingIsomorphic()
GroupingSQLValue
groupingIsomorphic
in interface GroupingSQLValue<IndexedReference>
public java.lang.String toString()
toString
in class java.lang.Object
public SQLExpression<java.lang.Integer> getIDExpression()
IndexedSQLValue
SQLExpression
for the id of the referenced value.
This is used to provide match filters for two references.getIDExpression
in interface IndexedSQLValue<T extends DataObject,I extends DataObject>
SQLExpression