T - type of owning objectI - type of remote objectpublic class IndexedFieldValue<T extends DataObject,I extends DataObject> extends java.lang.Object implements FieldValue<IndexedReference,T>, IndexedSQLValue<T,I>, Selector, GroupingSQLValue<IndexedReference>
| Constructor and Description |
|---|
IndexedFieldValue(java.lang.Class<T> target,
Repository repository,
IndexedTypeProducer<I,? extends DataObjectFactory<I>> producer) |
| 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<I> |
getFactory()
get the remote
DataObjectFactory |
java.lang.String |
getFieldName()
Get the corresponding field name.
|
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. |
SQLExpression<java.lang.Integer> |
getIDExpression()
Get a Integer valued
SQLExpression for the id of the referenced value. |
I |
getIndexed(T r) |
Input |
getInput()
get the Input associated with this object.
|
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.
|
IndexedTypeProducer<I,? extends DataObjectFactory<I>> |
getProducer() |
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.
|
IndexedReference<I> |
getValue(T r)
get the value from the target object
|
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.
|
IndexedReference<I> |
makeReference(int id) |
void |
setObject(java.sql.PreparedStatement stmt,
int pos,
IndexedReference value)
Add an object of the target type to a prepared statement doing any necessary type conversion
to map it to the SQL representation of the object (as generated by
FieldValue.addField(StringBuilder, boolean)
Note this is only valid if canSet from SQLAccessor returns true. |
void |
setValue(T r,
IndexedReference value)
Set value if supported otherwise throw a
UnsupportedOperationException. |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddFieldaddGroup, checkContentsCanGroup, getGroupParameters, groupingIsomorphicpublic IndexedFieldValue(java.lang.Class<T> target, Repository repository, IndexedTypeProducer<I,? extends DataObjectFactory<I>> producer)
public IndexedReference<I> getValue(T r)
AccessorgetValue in interface Accessor<IndexedReference,T extends DataObject>r - target objectpublic IndexedTypeProducer<I,? extends DataObjectFactory<I>> getProducer()
public int add(java.lang.StringBuilder sb,
boolean qualify)
SQLValueadd 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)
SQLValuegetParameters in interface SQLValue<IndexedReference>list - to modifypublic IndexedReference<I> makeObject(java.sql.ResultSet rs, int pos) throws DataException, java.sql.SQLException
SQLValuemakeObject in interface SQLValue<IndexedReference>rs - ResultSetDataExceptionjava.sql.SQLExceptionpublic IndexedReference<I> makeReference(int id)
public void setValue(T r, IndexedReference value)
AccessorUnsupportedOperationException.setValue in interface Accessor<IndexedReference,T extends DataObject>public void setObject(java.sql.PreparedStatement stmt,
int pos,
IndexedReference value)
throws java.sql.SQLException
FieldValueFieldValue.addField(StringBuilder, boolean)
Note this is only valid if canSet from SQLAccessor returns true.setObject in interface FieldValue<IndexedReference,T extends DataObject>java.sql.SQLExceptionpublic java.lang.Class<IndexedReference> getTarget()
TargettedgetTarget in interface Targetted<IndexedReference>public java.lang.String toString()
toString in class java.lang.Objectpublic SQLFilter<T> getFilter(MatchCondition match, IndexedReference val)
FilterProviderSQLFilter comparing against the target valuegetFilter in interface FilterProvider<T extends DataObject,IndexedReference>SQLFilterpublic SQLFilter<T> getNullFilter(boolean is_null)
FilterProviderSQLFilter checking if the target value is or is not null.getNullFilter in interface FilterProvider<T extends DataObject,IndexedReference>SQLFilterpublic SQLFilter<T> getOrderFilter(boolean descending)
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<T extends DataObject,IndexedReference>SQLFilterpublic SQLFilter<T> getSQLFilter(SQLFilter<I> fil) throws CannotFilterException
getSQLFilter in interface IndexedSQLValue<T extends DataObject,I extends DataObject>fil - CannotFilterExceptionpublic java.lang.String getFieldName()
FieldValuegetFieldName in interface FieldValue<IndexedReference,T extends DataObject>public SQLFilter getRequiredFilter()
SQLValuegetRequiredFilter in interface SQLValue<IndexedReference>public Input getInput()
Selectorpublic DataObjectFactory<I> getFactory() throws java.lang.Exception
IndexedSQLValueDataObjectFactorygetFactory in interface IndexedSQLValue<T extends DataObject,I extends DataObject>DataObjectFactoryjava.lang.Exceptionpublic boolean canSet()
AccessorAccessor support setting values.canSet in interface Accessor<IndexedReference,T extends DataObject>public java.lang.Class<T> getFilterType()
FilterProviderSQLFilter.getFilterType in interface FilterProvider<T extends DataObject,IndexedReference>public SQLExpression<java.lang.Integer> getIDExpression()
IndexedSQLValueSQLExpression 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