public class ObjectBuilder extends Object implements Cloneable, Serializable
Purpose: Object builder is one of the behaviour class attached to descriptor. It is responsible for building objects, rows, and extracting primary keys from the object and the rows.
Modifier and Type | Field and Description |
---|---|
protected List<DatabaseMapping> |
cloningMappings
PERF: Cache mappings that require cloning.
|
protected ClassDescriptor |
descriptor |
protected Vector<String> |
joinedAttributes
PERF: Cache mapping that use joining.
|
protected Map<String,DatabaseMapping> |
mappingsByAttribute |
protected Map<DatabaseField,DatabaseMapping> |
mappingsByField |
protected Vector<DatabaseMapping> |
nonPrimaryKeyMappings |
protected Vector<Class> |
primaryKeyClassifications |
protected Expression |
primaryKeyExpression |
protected Vector<DatabaseMapping> |
primaryKeyMappings |
protected Map<DatabaseField,Vector<DatabaseMapping>> |
readOnlyMappingsByField |
Constructor and Description |
---|
ObjectBuilder(ClassDescriptor descriptor) |
Modifier and Type | Method and Description |
---|---|
void |
addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow)
Add the primary key and its value to the databaseRow for all the non default tables.
|
void |
addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow,
Object object,
AbstractSession session)
Add the primary key and its value to the databaseRow for all the non default tables.
|
void |
assignReturnRow(Object object,
AbstractSession writeSession,
AbstractRecord row)
INTERNAL:
Assign returned row to object
|
void |
assignReturnValueForField(Object object,
ReadObjectQuery query,
AbstractRecord row,
DatabaseField field,
Collection handledMappings)
INTERNAL:
Assign values from objectRow to the object through all the mappings corresponding to the field.
|
protected void |
assignReturnValueToMapping(Object object,
ReadObjectQuery query,
AbstractRecord row,
DatabaseField field,
DatabaseMapping mapping,
Collection handledMappings)
INTERNAL:
Assign values from objectRow to the object through the mapping.
|
Object |
assignSequenceNumber(Object object,
AbstractSession writeSession)
INTERNAL:
Update the object primary key by fetching a new sequence number from the accessor.
|
void |
buildAttributesIntoObject(Object domainObject,
AbstractRecord databaseRow,
ObjectBuildingQuery query,
JoinedAttributeManager joinManager,
boolean forRefresh)
Each mapping is recursed to assign values from the databaseRow to the attributes in the domain object.
|
void |
buildAttributesIntoShallowObject(Object original,
AbstractRecord databaseRow,
ObjectBuildingQuery query)
INTERNAL:
For reading through the write connection when in transaction,
We need a partially populated original, so that we
can build a clone using the copy policy, even though we can't
put this original in the shared cache yet; just build a
shallow original (i.e.
|
void |
buildAttributesIntoWorkingCopyClone(Object clone,
ObjectBuildingQuery query,
JoinedAttributeManager joinManager,
AbstractRecord databaseRow,
UnitOfWorkImpl unitOfWork,
boolean forRefresh)
INTERNAL:
For reading through the write connection when in transaction,
populate the clone directly from the database row.
|
Object |
buildBackupClone(Object clone,
UnitOfWorkImpl unitOfWork)
Returns the clone of the specified object.
|
Expression |
buildDeleteExpression(DatabaseTable table,
AbstractRecord row)
Build and return the expression to use as the where clause to delete an object.
|
Object |
buildNewInstance()
Return a new instance of the receiver's javaClass.
|
protected Object |
buildObject(ObjectBuildingQuery query,
AbstractRecord databaseRow,
AbstractSession session,
Vector primaryKey,
ClassDescriptor concreteDescriptor,
JoinedAttributeManager joinManager)
Return an instance of the recievers javaClass.
|
Object |
buildObject(ObjectBuildingQuery query,
AbstractRecord databaseRow,
JoinedAttributeManager joinManager)
Return an instance of the recievers javaClass.
|
protected Object |
buildObjectInUnitOfWork(ObjectBuildingQuery query,
JoinedAttributeManager joinManager,
AbstractRecord databaseRow,
UnitOfWorkImpl unitOfWork,
Vector primaryKey,
ClassDescriptor concreteDescriptor)
For executing all reads on the UnitOfWork, the session when building
objects from rows will now be the UnitOfWork.
|
Object |
buildObjectsInto(ReadAllQuery query,
Vector databaseRows,
Object domainObjects)
Return a container which contains the instances of the receivers javaClass.
|
void |
buildPrimaryKeyAttributesIntoObject(Object original,
AbstractRecord databaseRow,
ObjectBuildingQuery query)
INTERNAL:
Build just the primary key mappings into the object.
|
Expression |
buildPrimaryKeyExpression(DatabaseTable table)
Build the primary key expression for the secondary table.
|
Expression |
buildPrimaryKeyExpressionFromKeys(Vector primaryKeyValues,
AbstractSession session)
Build the primary key expression from the specified primary key values.
|
Expression |
buildPrimaryKeyExpressionFromObject(Object domainObject,
AbstractSession session)
Build the primary key expression from the specified domain object.
|
AbstractRecord |
buildRow(AbstractRecord databaseRow,
Object object,
AbstractSession session)
Build the row representation of an object.
|
AbstractRecord |
buildRow(Object object,
AbstractSession session)
Build the row representation of an object.
|
AbstractRecord |
buildRowForShallowDelete(AbstractRecord databaseRow,
Object object,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForShallowDelete(Object object,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForShallowInsert(AbstractRecord databaseRow,
Object object,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForShallowInsert(Object object,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForShallowInsertWithChangeSet(AbstractRecord databaseRow,
ObjectChangeSet objectChangeSet,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForShallowInsertWithChangeSet(ObjectChangeSet objectChangeSet,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForTranslation(Object object,
AbstractSession session)
Build the row representation of an object.
|
AbstractRecord |
buildRowForUpdate(WriteObjectQuery query)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForUpdateWithChangeSet(WriteObjectQuery query)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForWhereClause(ObjectLevelModifyQuery query)
Build the row representation of an object.
|
AbstractRecord |
buildRowFromPrimaryKeyValues(Vector key,
AbstractSession session)
Build the row from the primary key values.
|
AbstractRecord |
buildRowWithChangeSet(AbstractRecord databaseRow,
ObjectChangeSet objectChangeSet,
AbstractSession session)
Build the row representation of an object.
|
AbstractRecord |
buildRowWithChangeSet(ObjectChangeSet objectChangeSet,
AbstractSession session)
Build the row representation of an object.
|
AbstractRecord |
buildTemplateInsertRow(AbstractSession session)
Build the row of all of the fields used for insertion.
|
void |
buildTemplateInsertRow(AbstractSession session,
AbstractRecord databaseRow) |
AbstractRecord |
buildTemplateUpdateRow(AbstractSession session)
Build the row representation of the object for update.
|
Expression |
buildUpdateExpression(DatabaseTable table,
AbstractRecord transactionRow,
AbstractRecord modifyRow)
Build and return the expression to use as the where clause to an update object.
|
protected Object |
buildWorkingCopyCloneFromRow(ObjectBuildingQuery query,
JoinedAttributeManager joinManager,
AbstractRecord databaseRow,
UnitOfWorkImpl unitOfWork,
Vector primaryKey)
INTERNAL:
Builds a working copy clone directly from the database row.
|
protected Object |
buildWorkingCopyCloneNormally(ObjectBuildingQuery query,
AbstractRecord databaseRow,
UnitOfWorkImpl unitOfWork,
Vector primaryKey,
ClassDescriptor concreteDescriptor,
JoinedAttributeManager joinManager)
buildWorkingCopyCloneFromRow is an alternative to this which is the
normal behavior.
|
void |
cascadePerformRemove(Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
INTERNAL:
THis method is used by the UnitOfWork to cascade registration of new objects.
|
void |
cascadeRegisterNewForCreate(Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
INTERNAL:
THis method is used by the UnitOfWork to cascade registration of new objects.
|
Object |
clone()
Returns clone of itself
|
ObjectChangeSet |
compareForChange(Object clone,
Object backUp,
UnitOfWorkChangeSet changeSet,
AbstractSession session)
INTERNAL:
This method creates an records changes for a particular object
|
boolean |
compareObjects(Object firstObject,
Object secondObject,
AbstractSession session)
Compares the two specified objects
|
void |
copyInto(Object source,
Object target)
Copy each attribute from one object into the other.
|
void |
copyInto(Object source,
Object target,
boolean cloneOneToOneValueHolders)
Copy each attribute from one object into the other.
|
Object |
copyObject(Object original,
ObjectCopyingPolicy policy)
Return a copy of the object.
|
protected void |
copyQueryInfoToCacheKey(CacheKey cacheKey,
ObjectBuildingQuery query,
AbstractRecord databaseRow,
AbstractSession session,
ClassDescriptor concreteDescriptor)
Initialize a cache key.
|
ObjectChangeSet |
createObjectChangeSet(Object clone,
UnitOfWorkChangeSet uowChangeSet,
AbstractSession session)
INTERNAL:
Used by the ObjectBuilder to create an ObjectChangeSet for the specified clone object
|
ObjectChangeSet |
createObjectChangeSet(Object clone,
UnitOfWorkChangeSet uowChangeSet,
boolean isNew,
AbstractSession session)
INTERNAL:
Used by the ObjectBuilder to create an ObjectChangeSet for the specified clone object
|
void |
createPrimaryKeyExpression(AbstractSession session)
Creates and stores primary key expression.
|
AbstractRecord |
createRecord()
Create a new row/record for the object builder.
|
AbstractRecord |
createRecord(int size)
Create a new row/record for the object builder.
|
Vector |
extractPrimaryKeyFromExpression(boolean requiresExactMatch,
Expression expression,
AbstractRecord translationRow,
AbstractSession session)
Return the row with primary keys and their values from the given expression.
|
Vector |
extractPrimaryKeyFromObject(Object domainObject,
AbstractSession session)
Extract primary key attribute values from the domainObject.
|
Vector |
extractPrimaryKeyFromRow(AbstractRecord databaseRow,
AbstractSession session)
Extract primary key values from the specified row.
|
AbstractRecord |
extractPrimaryKeyRowFromExpression(Expression expression,
AbstractRecord translationRow,
AbstractSession session)
Return the row with primary keys and their values from the given expression.
|
AbstractRecord |
extractPrimaryKeyRowFromObject(Object domainObject,
AbstractSession session)
Extract primary key attribute values from the domainObject.
|
Object |
extractValueFromObjectForField(Object domainObject,
DatabaseField field,
AbstractSession session)
Extract the value of the primary key attribute from the specified object.
|
DatabaseMapping |
getBaseMappingForField(DatabaseField databaseField)
Return the base mapping for the given DatabaseField.
|
Object |
getBaseValueForField(DatabaseField databaseField,
Object domainObject)
Return the base value that is mapped to for given field.
|
List<DatabaseMapping> |
getCloningMappings()
PERF:
Return all mappings that require cloning.
|
ClassDescriptor |
getDescriptor()
Return the descriptor
|
Class |
getFieldClassification(DatabaseField fieldToClassify)
INTERNAL:
Return the classifiction for the field contained in the mapping.
|
DatabaseField |
getFieldForQueryKeyName(String name)
Return the field used for the query key name.
|
Vector<String> |
getJoinedAttributes()
INTERNAL:
Answers the attributes which are always joined to the original query on reads.
|
DatabaseMapping |
getMappingForAttributeName(String name)
Return the mapping for the specified attribute name.
|
DatabaseMapping |
getMappingForField(DatabaseField field)
Return al the mapping for the specified field.
|
protected Map<String,DatabaseMapping> |
getMappingsByAttribute()
Return all the mapping to attribute associations
|
Map<DatabaseField,DatabaseMapping> |
getMappingsByField()
INTERNAL:
Return all the mapping to field associations
|
protected Vector<DatabaseMapping> |
getNonPrimaryKeyMappings()
Return the non primary key mappings.
|
Object |
getParentObjectForField(DatabaseField databaseField,
Object domainObject)
Return the base value that is mapped to for given field.
|
Vector<Class> |
getPrimaryKeyClassifications()
Return primary key classifications.
|
Expression |
getPrimaryKeyExpression()
Return the primary key expression
|
Vector<DatabaseMapping> |
getPrimaryKeyMappings()
Return primary key mappings.
|
Map<DatabaseField,Vector<DatabaseMapping>> |
getReadOnlyMappingsByField()
INTERNAL:
Return all the read-only mapping to field associations
|
Vector<DatabaseMapping> |
getReadOnlyMappingsForField(DatabaseField field)
Return all the read-only mapping for the specified field.
|
DatabaseField |
getTargetFieldForQueryKeyName(String queryKeyName)
INTERNAL: return a database field based on a query key name
|
boolean |
hasJoinedAttributes()
INTERNAL:
Answers if any attributes are to be joined / returned in the same select
statement.
|
void |
initialize(AbstractSession session)
Cache all the mappings by their attribute and fields.
|
void |
initializeJoinedAttributes()
INTERNAL:
Iterates through all one to one mappings and checks if any of them use joining.
|
void |
initializePrimaryKey(AbstractSession session)
Cache primary key and non primary key mappings.
|
Object |
instantiateClone(Object domainObject,
AbstractSession session)
Returns the clone of the specified object.
|
Object |
instantiateWorkingCopyClone(Object domainObject,
AbstractSession session)
Returns the clone of the specified object.
|
Object |
instantiateWorkingCopyCloneFromRow(AbstractRecord row,
ObjectBuildingQuery query)
It is now possible to build working copy clones directly from rows.
|
boolean |
isPrimaryKeyMapping(DatabaseMapping mapping) |
void |
iterate(DescriptorIterator iterator)
INTERNAL:
Perform the itteration opperation on the objects attributes through the mappings.
|
void |
mergeChangesIntoObject(Object target,
ObjectChangeSet changeSet,
Object source,
MergeManager mergeManager)
INTERNAL:
Merge changes between the objects, this merge algorthim is dependent on the merge manager.
|
void |
mergeIntoObject(Object target,
boolean isUnInitialized,
Object source,
MergeManager mergeManager)
INTERNAL:
Merge the contents of one object into another, this merge algorthim is dependent on the merge manager.
|
void |
mergeIntoObject(Object target,
boolean isUnInitialized,
Object source,
MergeManager mergeManager,
boolean cascadeOnly)
INTERNAL:
Merge the contents of one object into another, this merge algorthim is dependent on the merge manager.
|
void |
populateAttributesForClone(Object original,
Object clone,
UnitOfWorkImpl unitOfWork,
JoinedAttributeManager joinedAttributeManager)
Clones the attributes of the specified object.
|
void |
rehashFieldDependancies(AbstractSession session)
Rehash any hashtables based on fields.
|
void |
setDescriptor(ClassDescriptor aDescriptor)
Set the descriptor.
|
protected void |
setMappingsByAttribute(Map<String,DatabaseMapping> theAttributeMappings)
All the mappings and their respective attribute associations are cached for performance improvement.
|
void |
setMappingsByField(Map<DatabaseField,DatabaseMapping> theFieldMappings)
INTERNAL:
All the mappings and their respective field associations are cached for performance improvement.
|
protected void |
setNonPrimaryKeyMappings(Vector<DatabaseMapping> theNonPrimaryKeyMappings)
The non primary key mappings are cached to improve performance.
|
protected void |
setPrimaryKeyClassifications(Vector<Class> primaryKeyClassifications)
Set primary key classifications.
|
void |
setPrimaryKeyExpression(Expression criteria)
The primary key expression is cached to improve performance.
|
protected void |
setPrimaryKeyMappings(Vector<DatabaseMapping> thePrimaryKeyMappings)
The primary key mappings are cached to improve performance.
|
void |
setReadOnlyMappingsByField(Map<DatabaseField,Vector<DatabaseMapping>> theReadOnlyFieldMappings)
INTERNAL:
All the read-only mappings and their respective field associations are cached for performance improvement.
|
String |
toString() |
Object |
unwrapObject(Object proxy,
AbstractSession session)
Unwrap the object if required.
|
void |
validate(AbstractSession session)
Validates the object builder.
|
boolean |
verifyDelete(Object object,
AbstractSession session)
Verify that an object has been deleted from the database.
|
Object |
wrapObject(Object implementation,
AbstractSession session)
Wrap the object if required.
|
protected ClassDescriptor descriptor
protected Map<String,DatabaseMapping> mappingsByAttribute
protected Map<DatabaseField,DatabaseMapping> mappingsByField
protected Map<DatabaseField,Vector<DatabaseMapping>> readOnlyMappingsByField
protected Vector<DatabaseMapping> primaryKeyMappings
protected transient Vector<DatabaseMapping> nonPrimaryKeyMappings
protected transient Expression primaryKeyExpression
protected List<DatabaseMapping> cloningMappings
public ObjectBuilder(ClassDescriptor descriptor)
public AbstractRecord createRecord()
public AbstractRecord createRecord(int size)
public void addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow)
public void addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow, Object object, AbstractSession session)
public void assignReturnRow(Object object, AbstractSession writeSession, AbstractRecord row) throws DatabaseException
DatabaseException
public void assignReturnValueForField(Object object, ReadObjectQuery query, AbstractRecord row, DatabaseField field, Collection handledMappings)
protected void assignReturnValueToMapping(Object object, ReadObjectQuery query, AbstractRecord row, DatabaseField field, DatabaseMapping mapping, Collection handledMappings)
public Object assignSequenceNumber(Object object, AbstractSession writeSession) throws DatabaseException
DatabaseException
- - an error has occurred on the database.public void buildAttributesIntoObject(Object domainObject, AbstractRecord databaseRow, ObjectBuildingQuery query, JoinedAttributeManager joinManager, boolean forRefresh) throws DatabaseException
DatabaseException
public Object buildBackupClone(Object clone, UnitOfWorkImpl unitOfWork)
public Expression buildDeleteExpression(DatabaseTable table, AbstractRecord row)
public Object buildNewInstance()
public Object buildObject(ObjectBuildingQuery query, AbstractRecord databaseRow, JoinedAttributeManager joinManager) throws DatabaseException, QueryException
DatabaseException
QueryException
protected Object buildObjectInUnitOfWork(ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, UnitOfWorkImpl unitOfWork, Vector primaryKey, ClassDescriptor concreteDescriptor) throws DatabaseException, QueryException
Decides whether to call either buildWorkingCopyCloneFromRow (bypassing shared cache) or buildWorkingCopyCloneNormally (placing the result in the shared cache).
DatabaseException
QueryException
protected Object buildWorkingCopyCloneNormally(ObjectBuildingQuery query, AbstractRecord databaseRow, UnitOfWorkImpl unitOfWork, Vector primaryKey, ClassDescriptor concreteDescriptor, JoinedAttributeManager joinManager) throws DatabaseException, QueryException
This default behavior is only safe when the query is executed on a read connection, otherwise uncommitted data might get loaded into the shared cache.
Represents the way TopLink has always worked.
DatabaseException
QueryException
protected Object buildObject(ObjectBuildingQuery query, AbstractRecord databaseRow, AbstractSession session, Vector primaryKey, ClassDescriptor concreteDescriptor, JoinedAttributeManager joinManager) throws DatabaseException, QueryException
DatabaseException
QueryException
public Object buildObjectsInto(ReadAllQuery query, Vector databaseRows, Object domainObjects) throws DatabaseException
DatabaseException
public Expression buildPrimaryKeyExpression(DatabaseTable table) throws DescriptorException
DescriptorException
public Expression buildPrimaryKeyExpressionFromKeys(Vector primaryKeyValues, AbstractSession session)
public Expression buildPrimaryKeyExpressionFromObject(Object domainObject, AbstractSession session)
public AbstractRecord buildRow(Object object, AbstractSession session)
public AbstractRecord buildRow(AbstractRecord databaseRow, Object object, AbstractSession session)
public AbstractRecord buildRowForShallowDelete(Object object, AbstractSession session)
public AbstractRecord buildRowForShallowDelete(AbstractRecord databaseRow, Object object, AbstractSession session)
public AbstractRecord buildRowForShallowInsert(Object object, AbstractSession session)
public AbstractRecord buildRowForShallowInsert(AbstractRecord databaseRow, Object object, AbstractSession session)
public AbstractRecord buildRowWithChangeSet(ObjectChangeSet objectChangeSet, AbstractSession session)
public AbstractRecord buildRowWithChangeSet(AbstractRecord databaseRow, ObjectChangeSet objectChangeSet, AbstractSession session)
public AbstractRecord buildRowForShallowInsertWithChangeSet(ObjectChangeSet objectChangeSet, AbstractSession session)
public AbstractRecord buildRowForShallowInsertWithChangeSet(AbstractRecord databaseRow, ObjectChangeSet objectChangeSet, AbstractSession session)
public AbstractRecord buildRowForTranslation(Object object, AbstractSession session)
public AbstractRecord buildRowForUpdate(WriteObjectQuery query)
public AbstractRecord buildRowForUpdateWithChangeSet(WriteObjectQuery query)
public AbstractRecord buildRowForWhereClause(ObjectLevelModifyQuery query)
public AbstractRecord buildRowFromPrimaryKeyValues(Vector key, AbstractSession session)
public AbstractRecord buildTemplateInsertRow(AbstractSession session)
public void buildTemplateInsertRow(AbstractSession session, AbstractRecord databaseRow)
public AbstractRecord buildTemplateUpdateRow(AbstractSession session)
public Expression buildUpdateExpression(DatabaseTable table, AbstractRecord transactionRow, AbstractRecord modifyRow)
public void buildPrimaryKeyAttributesIntoObject(Object original, AbstractRecord databaseRow, ObjectBuildingQuery query) throws DatabaseException, QueryException
DatabaseException
QueryException
public void buildAttributesIntoShallowObject(Object original, AbstractRecord databaseRow, ObjectBuildingQuery query) throws DatabaseException, QueryException
DatabaseException
QueryException
public void buildAttributesIntoWorkingCopyClone(Object clone, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, UnitOfWorkImpl unitOfWork, boolean forRefresh) throws DatabaseException, QueryException
DatabaseException
QueryException
protected Object buildWorkingCopyCloneFromRow(ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, UnitOfWorkImpl unitOfWork, Vector primaryKey) throws DatabaseException, QueryException
DatabaseException
QueryException
public void cascadePerformRemove(Object object, UnitOfWorkImpl uow, IdentityHashtable visitedObjects)
public void cascadeRegisterNewForCreate(Object object, UnitOfWorkImpl uow, IdentityHashtable visitedObjects)
public ObjectChangeSet compareForChange(Object clone, Object backUp, UnitOfWorkChangeSet changeSet, AbstractSession session)
public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session)
public void copyInto(Object source, Object target, boolean cloneOneToOneValueHolders)
public void copyInto(Object source, Object target)
public Object copyObject(Object original, ObjectCopyingPolicy policy)
public ObjectChangeSet createObjectChangeSet(Object clone, UnitOfWorkChangeSet uowChangeSet, AbstractSession session)
clone
- java.lang.Object the object to convert to a changeSetuowChangeSet
- oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet the owner of this changeSetpublic ObjectChangeSet createObjectChangeSet(Object clone, UnitOfWorkChangeSet uowChangeSet, boolean isNew, AbstractSession session)
clone
- java.lang.Object the object to convert to a changeSetuowChangeSet
- oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet the owner of this changeSetisNew
- boolean signifies if the clone object is a new object.public void createPrimaryKeyExpression(AbstractSession session)
public Vector extractPrimaryKeyFromExpression(boolean requiresExactMatch, Expression expression, AbstractRecord translationRow, AbstractSession session)
public Vector extractPrimaryKeyFromObject(Object domainObject, AbstractSession session)
public Vector extractPrimaryKeyFromRow(AbstractRecord databaseRow, AbstractSession session)
public AbstractRecord extractPrimaryKeyRowFromExpression(Expression expression, AbstractRecord translationRow, AbstractSession session)
public AbstractRecord extractPrimaryKeyRowFromObject(Object domainObject, AbstractSession session)
public Object extractValueFromObjectForField(Object domainObject, DatabaseField field, AbstractSession session) throws DescriptorException
DescriptorException
public DatabaseMapping getBaseMappingForField(DatabaseField databaseField)
public Object getBaseValueForField(DatabaseField databaseField, Object domainObject)
public ClassDescriptor getDescriptor()
public Class getFieldClassification(DatabaseField fieldToClassify) throws DescriptorException
DescriptorException
public DatabaseField getFieldForQueryKeyName(String name)
public List<DatabaseMapping> getCloningMappings()
public Vector<String> getJoinedAttributes()
public boolean hasJoinedAttributes()
public DatabaseMapping getMappingForAttributeName(String name)
public DatabaseMapping getMappingForField(DatabaseField field)
public Vector<DatabaseMapping> getReadOnlyMappingsForField(DatabaseField field)
protected Map<String,DatabaseMapping> getMappingsByAttribute()
public Map<DatabaseField,DatabaseMapping> getMappingsByField()
public Map<DatabaseField,Vector<DatabaseMapping>> getReadOnlyMappingsByField()
protected Vector<DatabaseMapping> getNonPrimaryKeyMappings()
public Object getParentObjectForField(DatabaseField databaseField, Object domainObject)
public Vector<Class> getPrimaryKeyClassifications()
public Expression getPrimaryKeyExpression()
public Vector<DatabaseMapping> getPrimaryKeyMappings()
public DatabaseField getTargetFieldForQueryKeyName(String queryKeyName)
public void initialize(AbstractSession session) throws DescriptorException
DescriptorException
public void initializeJoinedAttributes()
By caching the result query execution in the case where there are no joined attributes can be improved.
protected void copyQueryInfoToCacheKey(CacheKey cacheKey, ObjectBuildingQuery query, AbstractRecord databaseRow, AbstractSession session, ClassDescriptor concreteDescriptor)
public void initializePrimaryKey(AbstractSession session) throws DescriptorException
DescriptorException
public Object instantiateClone(Object domainObject, AbstractSession session)
public Object instantiateWorkingCopyClone(Object domainObject, AbstractSession session)
public Object instantiateWorkingCopyCloneFromRow(AbstractRecord row, ObjectBuildingQuery query)
An intermediary original is no longer needed.
This has ramifications to the copy policy and cmp, for clones are no longer built via cloning.
Instead the copy policy must in some cases not copy at all. this allows the stub of the clone to be registered before cloning its parts.
public boolean isPrimaryKeyMapping(DatabaseMapping mapping)
public void iterate(DescriptorIterator iterator)
public void mergeChangesIntoObject(Object target, ObjectChangeSet changeSet, Object source, MergeManager mergeManager)
public void mergeIntoObject(Object target, boolean isUnInitialized, Object source, MergeManager mergeManager)
public void mergeIntoObject(Object target, boolean isUnInitialized, Object source, MergeManager mergeManager, boolean cascadeOnly)
public void populateAttributesForClone(Object original, Object clone, UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinedAttributeManager)
public void rehashFieldDependancies(AbstractSession session)
public void setDescriptor(ClassDescriptor aDescriptor)
protected void setMappingsByAttribute(Map<String,DatabaseMapping> theAttributeMappings)
public void setMappingsByField(Map<DatabaseField,DatabaseMapping> theFieldMappings)
public void setReadOnlyMappingsByField(Map<DatabaseField,Vector<DatabaseMapping>> theReadOnlyFieldMappings)
protected void setNonPrimaryKeyMappings(Vector<DatabaseMapping> theNonPrimaryKeyMappings)
protected void setPrimaryKeyClassifications(Vector<Class> primaryKeyClassifications)
public void setPrimaryKeyExpression(Expression criteria)
protected void setPrimaryKeyMappings(Vector<DatabaseMapping> thePrimaryKeyMappings)
public Object unwrapObject(Object proxy, AbstractSession session)
public void validate(AbstractSession session) throws DescriptorException
DescriptorException
public boolean verifyDelete(Object object, AbstractSession session)
public Object wrapObject(Object implementation, AbstractSession session)
Copyright © 2022. All rights reserved.