Package net.ontopia.persistence.proxy
Class ReferenceFieldInfo
- java.lang.Object
-
- net.ontopia.persistence.proxy.AbstractFieldInfo
-
- net.ontopia.persistence.proxy.ReferenceFieldInfo
-
- All Implemented Interfaces:
FieldHandlerIF,FieldInfoIF
public class ReferenceFieldInfo extends AbstractFieldInfo
INTERNAL: A field that references objects. A reference field is a field that references the identity of instances of a descriptor class. It is also known as a foreign key field.A reference field is a composite of one or more fields that together references the identity of an instance of a descriptor class. The number of fields and the types of those fields must match the identity fields of the referenced descriptor class.
-
-
Field Summary
Fields Modifier and Type Field Description protected intcolumn_countprotected FieldInfoIFidentity_fieldprotected ClassInfoIFvalue_cinfoprotected String[]value_columns-
Fields inherited from class net.ontopia.persistence.proxy.AbstractFieldInfo
cardinality, field, getter, index, is_collection, name, parent_cinfo, readonly, setter, value_class
-
Fields inherited from interface net.ontopia.persistence.proxy.FieldInfoIF
MANY_TO_MANY, ONE_TO_MANY, ONE_TO_ONE
-
-
Constructor Summary
Constructors Constructor Description ReferenceFieldInfo(ClassInfoIF parent_cinfo, FieldDescriptor field, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(Object value, PreparedStatement stm, int stmt_index)INTERNAL: Binds the identity keys to the containing fields.intgetColumnCount()INTERNAL: Returns the number of columns that the field spans.ClassInfoIFgetValueClassInfo()INTERNAL: Gets the class info for the field's value type.String[]getValueColumns()INTERNAL: Returns the names of the columns that the field spans.booleanisIdentityField()INTERNAL: Returns true if the field handler references an object identity field.Objectload(AccessRegistrarIF registrar, TicketIF ticket, ResultSet rs, int rsindex, boolean direct)INTERNAL: Loads from its containing fields the identity of an object.voidretrieveFieldValues(Object value, List<Object> field_values)voidretrieveSQLValues(Object value, List<SQLValueIF> sql_values)StringtoString()-
Methods inherited from class net.ontopia.persistence.proxy.AbstractFieldInfo
getCardinality, getDescriptor, getGetterMethod, getIndex, getJoinKeys, getJoinTable, getManyKeys, getName, getParentClassInfo, getSetterMethod, getTable, getValue, getValueClass, isAggregateField, isCollectionField, isPrimitiveField, isReadOnly, isReferenceField, setValue
-
-
-
-
Field Detail
-
value_cinfo
protected ClassInfoIF value_cinfo
-
identity_field
protected FieldInfoIF identity_field
-
value_columns
protected String[] value_columns
-
column_count
protected int column_count
-
-
Constructor Detail
-
ReferenceFieldInfo
public ReferenceFieldInfo(ClassInfoIF parent_cinfo, FieldDescriptor field, int index)
-
-
Method Detail
-
getValueClassInfo
public ClassInfoIF getValueClassInfo()
Description copied from interface:FieldInfoIFINTERNAL: Gets the class info for the field's value type. Note that primitive value classes don't have a class info.
-
getColumnCount
public int getColumnCount()
Description copied from interface:FieldHandlerIFINTERNAL: Returns the number of columns that the field spans.
-
isIdentityField
public boolean isIdentityField()
Description copied from interface:FieldHandlerIFINTERNAL: Returns true if the field handler references an object identity field.
-
getValueColumns
public String[] getValueColumns()
Description copied from interface:FieldInfoIFINTERNAL: Returns the names of the columns that the field spans.
-
load
public Object load(AccessRegistrarIF registrar, TicketIF ticket, ResultSet rs, int rsindex, boolean direct) throws SQLException
INTERNAL: Loads from its containing fields the identity of an object.- Throws:
SQLException
-
bind
public void bind(Object value, PreparedStatement stm, int stmt_index) throws SQLException
INTERNAL: Binds the identity keys to the containing fields.- Throws:
SQLException
-
retrieveSQLValues
public void retrieveSQLValues(Object value, List<SQLValueIF> sql_values)
-
-