T
- type of reference/repositoryR
- type of filterpublic abstract class AbstractSelfSQLValue<T extends DataObject,R> extends java.lang.Object implements SQLAccessor<IndexedReference,R>, FilterProvider<R,IndexedReference>, IndexedSQLValue<R,T>, GroupingSQLValue<IndexedReference>
SelfSQLValue
,
TupleSelfSQLValue
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Constructor and Description |
---|
AbstractSelfSQLValue(DataObjectFactory<T> fac) |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.StringBuilder sb,
boolean qualify)
Add the expression to a StringBuilder
|
boolean |
canSet()
does this
Accessor support setting values. |
DataObjectFactory<T> |
getFactory()
get the remote
DataObjectFactory |
SQLFilter<R> |
getFilter(MatchCondition match,
IndexedReference val)
Create a
SQLFilter comparing against the target value |
SQLExpression<java.lang.Integer> |
getIDExpression()
Get a Integer valued
SQLExpression for the id of the referenced value. |
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<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
|
IndexedReference<T> |
makeObject(java.sql.ResultSet rs,
int pos)
Extract a result of the expression from a ResultSet into an object of the specified type.
|
IndexedReference<T> |
makeReference(int id) |
void |
setValue(R r,
IndexedReference value)
Set value if supported otherwise throw a
UnsupportedOperationException . |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addGroup, checkContentsCanGroup, getGroupParameters
getSQLFilter
getFilterType
public AbstractSelfSQLValue(DataObjectFactory<T> fac)
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<R,T extends DataObject>
SQLExpression
public final 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 final java.util.List<PatternArgument> getParameters(java.util.List<PatternArgument> list)
SQLValue
getParameters
in interface SQLValue<IndexedReference>
list
- to modifypublic final IndexedReference<T> makeObject(java.sql.ResultSet rs, int pos) throws DataException, java.sql.SQLException
SQLValue
makeObject
in interface SQLValue<IndexedReference>
rs
- ResultSetDataException
java.sql.SQLException
public final IndexedReference<T> makeReference(int id)
public final java.lang.Class<IndexedReference> getTarget()
Targetted
getTarget
in interface Targetted<IndexedReference>
public java.lang.String toString()
toString
in class java.lang.Object
public final SQLFilter getRequiredFilter()
SQLValue
getRequiredFilter
in interface SQLValue<IndexedReference>
public final boolean canSet()
Accessor
Accessor
support setting values.canSet
in interface Accessor<IndexedReference,R>
public final void setValue(R r, IndexedReference value)
Accessor
UnsupportedOperationException
.setValue
in interface Accessor<IndexedReference,R>
public final SQLFilter<R> getFilter(MatchCondition match, IndexedReference val) throws CannotFilterException
FilterProvider
SQLFilter
comparing against the target valuegetFilter
in interface FilterProvider<R,IndexedReference>
SQLFilter
CannotFilterException
public final SQLFilter<R> getNullFilter(boolean is_null) throws CannotFilterException
FilterProvider
SQLFilter
checking if the target value is or is not null.getNullFilter
in interface FilterProvider<R,IndexedReference>
SQLFilter
CannotFilterException
public final SQLFilter<R> getOrderFilter(boolean descending) throws CannotFilterException
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,IndexedReference>
SQLFilter
CannotFilterException
public final DataObjectFactory<T> getFactory()
IndexedSQLValue
DataObjectFactory
getFactory
in interface IndexedSQLValue<R,T extends DataObject>
DataObjectFactory
public final boolean groupingIsomorphic()
GroupingSQLValue
groupingIsomorphic
in interface GroupingSQLValue<IndexedReference>