Purpose:
Nested tables are similar to VARRAYs except internally they store their information in a separate table
from their parent structure's table. The advantage of nested tables is that they support querying and
joining much better than varrays that are inlined into the parent table. A nested table is typically
used to represent a one-to-many or many-to-many relationship of references to another independent
structure. TopLink supports storing a nested table of values into a single field.
Note
Only Oracle8i supports nested tables type.
| Modifier and Type | Field and Description |
|---|---|
| protected DatabaseField | field
A ref is always stored in a single field. |
| protected DatabaseMapping | |
| protected String | structureName
Arrays require a structure name, this is the ADT defined for the VARRAY. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Expression | buildExpression(Object
TODO queryObject, QueryByExamplePolicy TODO policy, Expression TODO expressionBuilder, Map<K, V> TODO processedObjects, AbstractSession TODO session)Overrides org. |
| public Object | clone()
Overrides org. |
| protected Vector | collectFields()
Overrides org. |
| public DatabaseField | getField()
Overrides org. |
| public String | |
| public Expression | getJoinCriteria(ObjectExpression context, Expression base)
Overrides org. |
| public String | |
| public boolean | hasConstraintDependency()
Overrides org. |
| public void | initialize(AbstractSession session)
Overrides org. |
| protected void | initializeSelectionCriteria(AbstractSession session)
INTERNAL: Selection criteria is created to read target records (nested table) from the table. |
| public boolean | isNestedTableMapping()
Overrides org. |
| public void | postInitialize(AbstractSession session)
Overrides org. |
| public void | preDelete(DeleteObjectQuery query)
Overrides org. |
| public void | preInsert(WriteObjectQuery query)
Overrides org. |
| public void | preUpdate(WriteObjectQuery query)
Overrides org. |
| protected void | |
| public void | |
| public void | |
| protected void | verifyDeleteForUpdate(DeleteObjectQuery query)
INTERNAL: Verifying deletes make sure that all the records privately owned by this mapping are actually removed. |
| public void | writeFromObjectIntoRow(Object object, AbstractRecord record, AbstractSession session, DatabaseMapping.
Overrides org. |
| public void | writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord record, AbstractSession session)
Overrides org. |
| public void | writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session)
INTERNAL:
This row is built for shallow insert which happens in case of bidirectional inserts.
|
| public void | writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord record)
Overrides org. |
| public void | writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord record, AbstractSession session, DatabaseTable table)
Overrides org. |
| public void | writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session, DatabaseMapping.
Overrides org. |
| public void | writeInsertFieldsIntoRow(AbstractRecord record, AbstractSession session)
Overrides org. |
| field | back to summary |
|---|---|
| protected DatabaseField field A ref is always stored in a single field. | |
| nestedMapping | back to summary |
|---|---|
| protected DatabaseMapping nestedMapping | |
| structureName | back to summary |
|---|---|
| protected String structureName Arrays require a structure name, this is the ADT defined for the VARRAY. | |
| NestedTableMapping | back to summary |
|---|---|
| public NestedTableMapping() PUBLIC: Default constructor. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides org. INTERNAL: The mapping clones itself to create deep copy
| |
| collectFields | back to summary |
|---|---|
| protected Vector Overrides org. Returns all the aggregate fields.
| |
| getField | back to summary |
|---|---|
| public DatabaseField getField() Overrides org. INTERNAL: Returns the field which this mapping represents.
| |
| getFieldName | back to summary |
|---|---|
| public String getFieldName() PUBLIC: Return the name of the field this mapping represents. | |
| getJoinCriteria | back to summary |
|---|---|
| public Expression getJoinCriteria(ObjectExpression context, Expression base) Overrides org. INTERNAL: Join criteria is created to read target records (nested table) from the table.
| |
| getStructureName | back to summary |
|---|---|
| public String getStructureName() PUBLIC: Return the structure name of the nestedTable. This is the name of the user defined data type as defined on the database. | |
| hasConstraintDependency | back to summary |
|---|---|
| public boolean hasConstraintDependency() Overrides org. INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.
| |
| initialize | back to summary |
|---|---|
| public void initialize(AbstractSession session) throws DescriptorException Overrides org. INTERNAL: Initialize the mapping.
| |
| initializeSelectionCriteria | back to summary |
|---|---|
| protected void initializeSelectionCriteria(AbstractSession session) INTERNAL: Selection criteria is created to read target records (nested table) from the table. | |
| isNestedTableMapping | back to summary |
|---|---|
| public boolean isNestedTableMapping() Overrides org. INTERNAL:
| |
| postInitialize | back to summary |
|---|---|
| public void postInitialize(AbstractSession session) throws DescriptorException Overrides org. INTERNAL: Post Initialize the mapping.
| |
| preDelete | back to summary |
|---|---|
| public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException Overrides org. INTERNAL: Delete privately owned parts
| |
| preInsert | back to summary |
|---|---|
| public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException Overrides org. INTERNAL: Insert privately owned parts
| |
| preUpdate | back to summary |
|---|---|
| public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException Overrides org. INTERNAL: Update the privately owned parts
| |
| setField | back to summary |
|---|---|
| protected void setField(DatabaseField theField) Set the field in the mapping. | |
| setFieldName | back to summary |
|---|---|
| public void setFieldName(String FieldName) PUBLIC: Set the field name in the mapping. | |
| setStructureName | back to summary |
|---|---|
| public void setStructureName(String structureName) PUBLIC: Set the name of the structure. This is the name of the user defined nested table data type as defined on the database. | |
| verifyDeleteForUpdate | back to summary |
|---|---|
| protected void verifyDeleteForUpdate(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException INTERNAL: Verifying deletes make sure that all the records privately owned by this mapping are actually removed. If such records are found then those are all read and removed one by one taking their privately owned parts into account. | |
| writeFromObjectIntoRow | back to summary |
|---|---|
| public void writeFromObjectIntoRow(Object object, AbstractRecord record, AbstractSession session, DatabaseMapping. Overrides org. INTERNAL: Get a value from the object and set that in the respective field of the row.
| |
| writeFromObjectIntoRowForShallowInsert | back to summary |
|---|---|
| public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord record, AbstractSession session) Overrides org. INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.
| |
| writeFromObjectIntoRowForShallowInsertWithChangeRecord | back to summary |
|---|---|
| public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session) INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.
| |
| writeFromObjectIntoRowForUpdate | back to summary |
|---|---|
| public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord record) throws DescriptorException Overrides org. INTERNAL: Write the entire structure into the row as a special type that prints as the constructor. If any part of the structure has changed the whole thing is written.
| |
| writeFromObjectIntoRowForUpdateAfterShallowInsert | back to summary |
|---|---|
| public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord record, AbstractSession session, DatabaseTable table) Overrides org. INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts. It contains the foreign keys with non null values that were set to null for shallow insert.
| |
| writeFromObjectIntoRowWithChangeRecord | back to summary |
|---|---|
| public void writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session, DatabaseMapping. Overrides org. INTERNAL: Get a value from the object and set that in the respective field of the row.
| |
| writeInsertFieldsIntoRow | back to summary |
|---|---|
| public void writeInsertFieldsIntoRow(AbstractRecord record, AbstractSession session) Overrides org. INTERNAL: Write fields needed for insert into the template for with null values.
| |