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, wait
addField
addGroup, checkContentsCanGroup, getGroupParameters, groupingIsomorphic
public IndexedFieldValue(java.lang.Class<T> target, Repository repository, IndexedTypeProducer<I,? extends DataObjectFactory<I>> producer)
public IndexedReference<I> getValue(T r)
Accessor
getValue
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)
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, java.sql.SQLException
SQLValue
makeObject
in interface SQLValue<IndexedReference>
rs
- ResultSetDataException
java.sql.SQLException
public IndexedReference<I> makeReference(int id)
public void setValue(T r, IndexedReference value)
Accessor
UnsupportedOperationException
.setValue
in interface Accessor<IndexedReference,T extends DataObject>
public void setObject(java.sql.PreparedStatement stmt, int pos, IndexedReference value) throws java.sql.SQLException
FieldValue
FieldValue.addField(StringBuilder, boolean)
Note this is only valid if canSet from SQLAccessor
returns true.setObject
in interface FieldValue<IndexedReference,T extends DataObject>
java.sql.SQLException
public java.lang.Class<IndexedReference> getTarget()
Targetted
getTarget
in interface Targetted<IndexedReference>
public java.lang.String toString()
toString
in class java.lang.Object
public SQLFilter<T> getFilter(MatchCondition match, IndexedReference val)
FilterProvider
SQLFilter
comparing against the target valuegetFilter
in interface FilterProvider<T extends DataObject,IndexedReference>
SQLFilter
public SQLFilter<T> getNullFilter(boolean is_null)
FilterProvider
SQLFilter
checking if the target value is or is not null.getNullFilter
in interface FilterProvider<T extends DataObject,IndexedReference>
SQLFilter
public SQLFilter<T> getOrderFilter(boolean descending)
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
public SQLFilter<T> getSQLFilter(SQLFilter<I> fil) throws CannotFilterException
getSQLFilter
in interface IndexedSQLValue<T extends DataObject,I extends DataObject>
fil
- CannotFilterException
public java.lang.String getFieldName()
FieldValue
getFieldName
in interface FieldValue<IndexedReference,T extends DataObject>
public SQLFilter getRequiredFilter()
SQLValue
getRequiredFilter
in interface SQLValue<IndexedReference>
public Input getInput()
Selector
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 boolean canSet()
Accessor
Accessor
support setting values.canSet
in interface Accessor<IndexedReference,T extends DataObject>
public java.lang.Class<T> getFilterType()
FilterProvider
SQLFilter
.getFilterType
in interface FilterProvider<T extends DataObject,IndexedReference>
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