public class ObjectBuilder extends CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping> implements java.lang.Cloneable, java.io.Serializable
Purpose: Object builder is one of the behavior class attached to descriptor. It is responsible for building objects, rows, and extracting primary keys from the object and the rows.
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 Record for all the non default tables.
|
void |
addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow,
java.lang.Object object,
AbstractSession session)
Add the primary key and its value to the Record for all the non default tables.
|
void |
assignReturnRow(java.lang.Object object,
AbstractSession writeSession,
AbstractRecord row,
ObjectChangeSet changeSet)
Assign the fields in the row back into the object.
|
void |
assignReturnValueForField(java.lang.Object object,
ReadObjectQuery query,
AbstractRecord row,
DatabaseField field,
java.util.Collection handledMappings,
ObjectChangeSet changeSet)
Assign the field value from the row to the object for all the mappings using field (read or write).
|
java.lang.Object |
assignSequenceNumber(java.lang.Object object,
AbstractSession writeSession)
INTERNAL:
Update the object primary key by fetching a new sequence number from the accessor.
|
java.lang.Object |
assignSequenceNumber(WriteObjectQuery writeQuery)
INTERNAL:
Update the writeQuery's object primary key by fetching a new sequence number from the accessor.
|
void |
buildAttributesIntoObject(java.lang.Object domainObject,
CacheKey cacheKey,
AbstractRecord databaseRow,
ObjectBuildingQuery query,
JoinedAttributeManager joinManager,
FetchGroup executionFetchGroup,
boolean forRefresh,
AbstractSession targetSession)
Each mapping is recursed to assign values from the Record to the attributes in the domain object.
|
void |
buildAttributesIntoShallowObject(java.lang.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(java.lang.Object clone,
CacheKey sharedCacheKey,
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.
|
java.lang.Object |
buildBackupClone(java.lang.Object clone,
UnitOfWorkImpl unitOfWork)
Returns the backup clone of the specified object.
|
Expression |
buildDeleteExpression(DatabaseTable table,
AbstractRecord row,
boolean usesOptimisticLocking)
Build and return the expression to use as the where clause to delete an object.
|
Expression |
buildExpressionFromExample(java.lang.Object queryObject,
QueryByExamplePolicy policy,
Expression expressionBuilder,
java.util.Map processedObjects,
AbstractSession session)
INTERNAL:
This method is used when Query By Example is used.
|
java.lang.Object |
buildNewInstance()
Return a new instance of the receiver's javaClass.
|
java.lang.Object |
buildObject(ObjectBuildingQuery query,
AbstractRecord databaseRow,
JoinedAttributeManager joinManager)
Return an instance of the receivers javaClass.
|
java.lang.Object |
buildObject(ObjectBuildingQuery query,
AbstractRecord databaseRow,
JoinedAttributeManager joinManager,
AbstractSession session,
ClassDescriptor concreteDescriptor,
InheritancePolicy inheritancePolicy,
boolean isUnitOfWork,
boolean shouldCacheQueryResults,
boolean shouldUseWrapperPolicy)
Return an instance of the receivers javaClass.
|
java.lang.Object |
buildObject(ObjectLevelReadQuery query,
AbstractRecord databaseRow)
Return an instance of the receivers javaClass.
|
java.lang.Object |
buildObjectFromResultSet(ObjectBuildingQuery query,
JoinedAttributeManager joinManager,
java.sql.ResultSet resultSet,
AbstractSession executionSession,
DatabaseAccessor accessor,
java.sql.ResultSetMetaData metaData,
DatabasePlatform platform,
java.util.Vector fieldsList,
DatabaseField[] fieldsArray)
INTERNAL:
Builds a working copy clone directly from a result set.
|
java.lang.Object |
buildObjectsFromCursorInto(ReadAllQuery query,
java.util.List databaseRows,
java.lang.Object domainObjects)
Return a container which contains the instances of the receivers javaClass.
|
java.lang.Object |
buildObjectsFromResultSetInto(ReadAllQuery query,
java.sql.ResultSet resultSet,
java.util.Vector fields,
DatabaseField[] fieldsArray,
java.lang.Object domainObjects)
Version of buildObjectsInto method that takes call instead of rows.
|
java.lang.Object |
buildObjectsInto(ReadAllQuery query,
java.util.List databaseRows,
java.lang.Object domainObjects)
Return a container which contains the instances of the receivers javaClass.
|
void |
buildPrimaryKeyAttributesIntoObject(java.lang.Object original,
AbstractRecord databaseRow,
ObjectBuildingQuery query,
AbstractSession session)
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(java.lang.Object primaryKey,
AbstractSession session)
Build the primary key expression from the specified primary key values.
|
Expression |
buildPrimaryKeyExpressionFromObject(java.lang.Object domainObject,
AbstractSession session)
Build the primary key expression from the specified domain object.
|
AbstractRecord |
buildRow(AbstractRecord databaseRow,
java.lang.Object object,
AbstractSession session,
DatabaseMapping.WriteType writeType)
Build the row representation of an object.
|
AbstractRecord |
buildRow(java.lang.Object object,
AbstractSession session,
DatabaseMapping.WriteType writeType)
Build the row representation of an object.
|
AbstractRecord |
buildRowForShallowInsert(AbstractRecord databaseRow,
java.lang.Object object,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForShallowInsert(java.lang.Object object,
AbstractSession session)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForTranslation(java.lang.Object object,
AbstractSession session)
Build the row representation of an object.
|
AbstractRecord |
buildRowForUpdate(AbstractRecord databaseRow,
WriteObjectQuery query)
Build into the row representation of the object for update.
|
AbstractRecord |
buildRowForUpdate(WriteObjectQuery query)
Build the row representation of the object for update.
|
AbstractRecord |
buildRowForUpdateAfterShallowInsert(AbstractRecord databaseRow,
java.lang.Object object,
AbstractSession session,
DatabaseTable table)
Build the row representation of the object that contains only the fields nullified by shallow insert.
|
AbstractRecord |
buildRowForUpdateAfterShallowInsert(java.lang.Object object,
AbstractSession session,
DatabaseTable table)
Build the row representation of the object that contains only the fields nullified by shallow insert.
|
AbstractRecord |
buildRowForUpdateBeforeShallowDelete(AbstractRecord databaseRow,
java.lang.Object object,
AbstractSession session,
DatabaseTable table)
Build the row representation of the object that contains only the fields nullified by shallow insert, with all values set to null.
|
AbstractRecord |
buildRowForUpdateBeforeShallowDelete(java.lang.Object object,
AbstractSession session,
DatabaseTable table)
Build the row representation of the object that contains only the fields nullified by shallow insert, with all values set to null.
|
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(java.lang.Object key,
AbstractSession session)
Build the row from the primary key values.
|
AbstractRecord |
buildRowWithChangeSet(AbstractRecord databaseRow,
ObjectChangeSet objectChangeSet,
AbstractSession session,
DatabaseMapping.WriteType writeType)
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.
|
void |
cacheForeignKeyValues(AbstractRecord databaseRecord,
CacheKey cacheKey,
AbstractSession session)
INTERNAL:
This method is used to store the FK values used for this mapping in the cachekey.
|
void |
cacheForeignKeyValues(java.lang.Object source,
CacheKey cacheKey,
ClassDescriptor descriptor,
AbstractSession session)
INTERNAL:
This method is used to store the FK values used for this mapping in the cachekey.
|
void |
cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object,
java.util.Map newObjects,
java.util.Map unregisteredExistingObjects,
java.util.Map visitedObjects,
UnitOfWorkImpl uow,
java.util.Set cascadeErrors)
INTERNAL:
Cascade discover and persist new objects during commit.
|
void |
cascadePerformRemove(java.lang.Object object,
UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL:
This method is used by the UnitOfWork to cascade registration of new objects.
|
void |
cascadePerformRemovePrivateOwnedObjectFromChangeSet(java.lang.Object object,
UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL:
This method is used to iterate over the specified object's mappings and cascade
remove orphaned private owned objects from the UnitOfWorkChangeSet and IdentityMap.
|
void |
cascadeRegisterNewForCreate(java.lang.Object object,
UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL:
This method is used by the UnitOfWork to cascade registration of new objects.
|
void |
clearPrimaryKey(java.lang.Object object)
Clear any primary key cache data in the object.
|
java.lang.Object |
clone()
Returns a clone of itself.
|
ObjectChangeSet |
compareForChange(java.lang.Object clone,
java.lang.Object backUp,
UnitOfWorkChangeSet changeSet,
AbstractSession session)
INTERNAL:
This method creates a records change set for a particular object.
|
boolean |
compareObjects(java.lang.Object firstObject,
java.lang.Object secondObject,
AbstractSession session)
Compares the two specified objects
|
void |
copyInto(java.lang.Object source,
java.lang.Object target)
Copy each attribute from one object into the other.
|
void |
copyInto(java.lang.Object source,
java.lang.Object target,
boolean cloneOneToOneValueHolders)
Copy each attribute from one object into the other.
|
java.lang.Object |
copyObject(java.lang.Object original,
CopyGroup copyGroup)
Return a copy of the object.
|
ObjectChangeSet |
createObjectChangeSet(java.lang.Object clone,
UnitOfWorkChangeSet uowChangeSet,
AbstractSession session)
INTERNAL:
Used by the ObjectBuilder to create an ObjectChangeSet for the specified clone object.
|
ObjectChangeSet |
createObjectChangeSet(java.lang.Object clone,
UnitOfWorkChangeSet uowChangeSet,
boolean isNew,
AbstractSession session)
INTERNAL:
Used by the ObjectBuilder to create an ObjectChangeSet for the specified clone object.
|
ObjectChangeSet |
createObjectChangeSet(java.lang.Object clone,
UnitOfWorkChangeSet uowChangeSet,
boolean isNew,
boolean assignPrimaryKeyIfExisting,
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(AbstractSession session)
Create a new row/record for the object builder.
|
AbstractRecord |
createRecord(int size,
AbstractSession session)
Create a new row/record for the object builder.
|
AbstractRecord |
createRecordFromXMLContext(XMLContext context)
Create a new row/record from XMLContext.
|
java.lang.Object |
extractPrimaryKeyFromExpression(boolean requiresExactMatch,
Expression expression,
AbstractRecord translationRow,
AbstractSession session)
Return the row with primary keys and their values from the given expression.
|
java.lang.Object |
extractPrimaryKeyFromObject(java.lang.Object domainObject,
AbstractSession session)
Extract primary key attribute values from the domainObject.
|
java.lang.Object |
extractPrimaryKeyFromObject(java.lang.Object domainObject,
AbstractSession session,
boolean shouldReturnNullIfNull)
Extract primary key attribute values from the domainObject.
|
java.lang.Object |
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(java.lang.Object domainObject,
AbstractSession session)
Extract primary key attribute values from the domainObject.
|
AbstractRecord |
extractRowFromExpression(Expression expression,
AbstractRecord translationRow,
AbstractSession session)
Return the row from the given expression.
|
java.lang.Object |
extractValueFromObjectForField(java.lang.Object domainObject,
DatabaseField field,
AbstractSession session)
Extract the value of the primary key attribute from the specified object.
|
void |
fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
DistributedSession session)
INTERNAL:
An object has been serialized from the server to the client.
|
ChangeRecord |
getBaseChangeRecordForField(ObjectChangeSet objectChangeSet,
java.lang.Object object,
DatabaseField databaseField,
AbstractSession session)
Return the base ChangeRecord for the given DatabaseField.
|
DatabaseMapping |
getBaseMappingForField(DatabaseField databaseField)
Return the base mapping for the given DatabaseField.
|
java.lang.Object |
getBaseValueForField(DatabaseField databaseField,
java.lang.Object domainObject)
Return the base value that is mapped to for given field.
|
java.util.List<DatabaseMapping> |
getBatchFetchedAttributes()
Return the mappings that are always batch fetched.
|
java.util.List<DatabaseMapping> |
getCloningMappings()
PERF:
Return all mappings that require cloning.
|
ClassDescriptor |
getDescriptor()
Return the descriptor
|
java.util.List<DatabaseMapping> |
getEagerMappings()
PERF:
Return all mappings that are eager loaded (but use indirection).
|
java.lang.Class |
getFieldClassification(DatabaseField fieldToClassify)
INTERNAL:
Return the classification for the field contained in the mapping.
|
DatabaseField |
getFieldForQueryKeyName(java.lang.String name)
Return the field used for the query key name.
|
java.util.Map<DatabaseField,DatabaseField> |
getFieldsMap()
Return the fields map.
|
java.util.List<DatabaseMapping> |
getJoinedAttributes()
Answers the attributes which are always joined to the original query on reads.
|
java.lang.String |
getLockAttribute() |
DatabaseMapping |
getMappingForAttributeName(java.lang.String name)
Return the mapping for the specified attribute name.
|
DatabaseMapping |
getMappingForField(DatabaseField field)
Return al the mapping for the specified field.
|
java.util.Map<DatabaseField,DatabaseMapping> |
getMappingsByField()
INTERNAL:
Return all the mapping to field associations
|
java.lang.Object |
getParentObjectForField(DatabaseField databaseField,
java.lang.Object domainObject)
Return the base value that is mapped to for given field.
|
java.util.List<java.lang.Class> |
getPrimaryKeyClassifications()
Return primary key classifications.
|
Expression |
getPrimaryKeyExpression()
Return the primary key expression
|
java.util.List<DatabaseMapping> |
getPrimaryKeyMappings()
Return primary key mappings.
|
java.util.Map<DatabaseField,java.util.List<DatabaseMapping>> |
getReadOnlyMappingsByField()
INTERNAL:
Return all the read-only mapping to field associations
|
java.util.List<DatabaseMapping> |
getReadOnlyMappingsForField(DatabaseField field)
Return all the read-only mapping for the specified field.
|
java.util.List<DatabaseMapping> |
getRelationshipMappings()
PERF:
Return all relationship mappings.
|
AbstractDirectMapping |
getSequenceMapping()
PERF:
Return the sequence mapping.
|
DatabaseField |
getTargetFieldForQueryKeyName(java.lang.String queryKeyName)
INTERNAL: return a database field based on a query key name
|
boolean |
hasBatchFetchedAttributes()
Return is any mappings are always batch fetched.
|
boolean |
hasCacheIndexesInSopObject() |
boolean |
hasInBatchFetchedAttribute()
Return is any mappings are always batch fetched using IN.
|
boolean |
hasJoinedAttributes()
Answers if any attributes are to be joined / returned in the same select
statement.
|
boolean |
hasWrapperPolicy()
Return if the descriptor has a wrapper policy.
|
void |
initialize(AbstractSession session)
Cache all the mappings by their attribute and fields.
|
void |
initializeBatchFetchedAttributes()
INTERNAL:
Iterates through all one to one mappings and checks if any of them use batch fetching.
|
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.
|
java.lang.Object |
instantiateClone(java.lang.Object domainObject,
AbstractSession session)
Returns the clone of the specified object.
|
void |
instantiateEagerMappings(java.lang.Object object,
AbstractSession session)
Force instantiation to any eager mappings.
|
java.lang.Object |
instantiateWorkingCopyClone(java.lang.Object domainObject,
AbstractSession session)
Returns the clone of the specified object.
|
java.lang.Object |
instantiateWorkingCopyCloneFromRow(AbstractRecord row,
ObjectBuildingQuery query,
java.lang.Object primaryKey,
UnitOfWorkImpl unitOfWork)
It is now possible to build working copy clones directly from rows.
|
boolean |
isPrimaryKeyComponentInvalid(java.lang.Object keyValue,
int index) |
boolean |
isPrimaryKeyExpression(boolean requiresExactMatch,
Expression expression,
AbstractSession session)
Return if the expression is by primary key.
|
boolean |
isPrimaryKeyMapping(DatabaseMapping mapping) |
boolean |
isSimple()
PERF:
Return if the descriptor has no complex mappings, all direct.
|
boolean |
isXMLObjectBuilder() |
void |
iterate(DescriptorIterator iterator)
INTERNAL:
Perform the iteration operation on the objects attributes through the mappings.
|
void |
load(java.lang.Object object,
AttributeGroup group,
AbstractSession session,
boolean fromFetchGroup)
Force instantiation to any mappings in the load group.
|
void |
loadAll(java.lang.Object object,
AbstractSession session)
Force instantiation of all indirections.
|
void |
loadAll(java.lang.Object object,
AbstractSession session,
IdentityHashSet loaded) |
void |
mergeChangesIntoObject(java.lang.Object target,
ObjectChangeSet changeSet,
java.lang.Object source,
MergeManager mergeManager,
AbstractSession targetSession)
INTERNAL:
Merge changes between the objects, this merge algorithm is dependent on the merge manager.
|
void |
mergeChangesIntoObject(java.lang.Object target,
ObjectChangeSet changeSet,
java.lang.Object source,
MergeManager mergeManager,
AbstractSession targetSession,
boolean isTargetCloneOfOriginal,
boolean shouldMergeFetchGroup)
INTERNAL:
Merge changes between the objects, this merge algorithm is dependent on the merge manager.
|
void |
mergeIntoObject(java.lang.Object target,
boolean isUnInitialized,
java.lang.Object source,
MergeManager mergeManager,
AbstractSession targetSession)
INTERNAL:
Merge the contents of one object into another, this merge algorithm is dependent on the merge manager.
|
void |
mergeIntoObject(java.lang.Object target,
ObjectChangeSet changeSet,
boolean isUnInitialized,
java.lang.Object source,
MergeManager mergeManager,
AbstractSession targetSession,
boolean cascadeOnly,
boolean isTargetCloneOfOriginal,
boolean shouldMergeFetchGroup)
INTERNAL:
Merge the contents of one object into another, this merge algorithm is dependent on the merge manager.
|
void |
populateAttributesForClone(java.lang.Object original,
CacheKey cacheKey,
java.lang.Object clone,
java.lang.Integer refreshCascade,
AbstractSession cloningSession)
Clones the attributes of the specified object.
|
void |
postInitialize(AbstractSession session)
INTERNAL:
Post initializations after mappings are initialized.
|
void |
recordPrivateOwnedRemovals(java.lang.Object object,
UnitOfWorkImpl uow,
boolean initialPass) |
void |
rehashFieldDependancies(AbstractSession session)
Rehash any maps based on fields.
|
void |
setDescriptor(ClassDescriptor aDescriptor)
Set the descriptor.
|
void |
setHasInBatchFetchedAttribute(boolean hasInBatchFetchedAttribute)
Set if any mappings are always batch fetched using IN.
|
void |
setHasWrapperPolicy(boolean hasWrapperPolicy)
Set if the descriptor has a wrapper policy.
|
void |
setMappingsByField(java.util.Map<DatabaseField,DatabaseMapping> theFieldMappings)
INTERNAL:
All the mappings and their respective field associations are cached for performance improvement.
|
void |
setPrimaryKeyClassifications(java.util.List<java.lang.Class> primaryKeyClassifications)
INTERNAL:
Set primary key classifications.
|
void |
setPrimaryKeyExpression(Expression criteria)
The primary key expression is cached to improve performance.
|
void |
setReadOnlyMappingsByField(java.util.Map<DatabaseField,java.util.List<DatabaseMapping>> theReadOnlyFieldMappings)
INTERNAL:
All the read-only mappings and their respective field associations are cached for performance improvement.
|
void |
setSequenceMapping(AbstractDirectMapping sequenceMapping)
PERF:
Set the sequence mapping.
|
boolean |
shouldKeepRow() |
java.lang.String |
toString() |
void |
trimFieldsForInsert(AbstractSession session,
AbstractRecord databaseRow)
INTERNAL
Remove a potential sequence number field and invoke the ReturningPolicy trimModifyRowsForInsert method
|
java.lang.Object |
unwrapObject(java.lang.Object proxy,
AbstractSession session)
Unwrap the object if required.
|
void |
updateCachedAttributes(PersistenceEntity persistenceEntity,
CacheKey cacheKey,
java.lang.Object primaryKey)
INTERNAL:
Used to updated any attributes that may be cached on a woven entity
|
void |
validate(AbstractSession session)
Validates the object builder.
|
boolean |
verifyDelete(java.lang.Object object,
AbstractSession session)
Verify that an object has been deleted from the database.
|
java.lang.Object |
wrapObject(java.lang.Object implementation,
AbstractSession session)
Wrap the object if required.
|
AbstractRecord |
writeIntoRowFromPrimaryKeyValues(AbstractRecord row,
java.lang.Object primaryKey,
AbstractSession session,
boolean convert)
Build the row from the primary key values.
|
public ObjectBuilder(ClassDescriptor descriptor)
public AbstractRecord createRecord(AbstractSession session)
createRecord
in class CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping>
public AbstractRecord createRecord(int size, AbstractSession session)
public void addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow)
public void addPrimaryKeyForNonDefaultTable(AbstractRecord databaseRow, java.lang.Object object, AbstractSession session)
public void clearPrimaryKey(java.lang.Object object)
public void assignReturnRow(java.lang.Object object, AbstractSession writeSession, AbstractRecord row, ObjectChangeSet changeSet) throws DatabaseException
DatabaseException
public void assignReturnValueForField(java.lang.Object object, ReadObjectQuery query, AbstractRecord row, DatabaseField field, java.util.Collection handledMappings, ObjectChangeSet changeSet)
public java.lang.Object assignSequenceNumber(java.lang.Object object, AbstractSession writeSession) throws DatabaseException
DatabaseException
- - an error has occurred on the database.public java.lang.Object assignSequenceNumber(WriteObjectQuery writeQuery) throws DatabaseException
DatabaseException
- - an error has occurred on the database.public void buildAttributesIntoObject(java.lang.Object domainObject, CacheKey cacheKey, AbstractRecord databaseRow, ObjectBuildingQuery query, JoinedAttributeManager joinManager, FetchGroup executionFetchGroup, boolean forRefresh, AbstractSession targetSession) throws DatabaseException
DatabaseException
public java.lang.Object buildBackupClone(java.lang.Object clone, UnitOfWorkImpl unitOfWork)
public Expression buildDeleteExpression(DatabaseTable table, AbstractRecord row, boolean usesOptimisticLocking)
public Expression buildExpressionFromExample(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, AbstractSession session)
public java.lang.Object buildNewInstance()
buildNewInstance
in class CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping>
public java.lang.Object buildObject(ObjectLevelReadQuery query, AbstractRecord databaseRow)
public java.lang.Object buildObject(ObjectBuildingQuery query, AbstractRecord databaseRow, JoinedAttributeManager joinManager)
public java.lang.Object buildObject(ObjectBuildingQuery query, AbstractRecord databaseRow, JoinedAttributeManager joinManager, AbstractSession session, ClassDescriptor concreteDescriptor, InheritancePolicy inheritancePolicy, boolean isUnitOfWork, boolean shouldCacheQueryResults, boolean shouldUseWrapperPolicy)
public void instantiateEagerMappings(java.lang.Object object, AbstractSession session)
public void load(java.lang.Object object, AttributeGroup group, AbstractSession session, boolean fromFetchGroup)
public void loadAll(java.lang.Object object, AbstractSession session)
public void loadAll(java.lang.Object object, AbstractSession session, IdentityHashSet loaded)
public java.lang.Object buildObjectsInto(ReadAllQuery query, java.util.List databaseRows, java.lang.Object domainObjects)
public java.lang.Object buildObjectsFromResultSetInto(ReadAllQuery query, java.sql.ResultSet resultSet, java.util.Vector fields, DatabaseField[] fieldsArray, java.lang.Object domainObjects) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object buildObjectsFromCursorInto(ReadAllQuery query, java.util.List databaseRows, java.lang.Object domainObjects)
public Expression buildPrimaryKeyExpression(DatabaseTable table) throws DescriptorException
DescriptorException
public Expression buildPrimaryKeyExpressionFromKeys(java.lang.Object primaryKey, AbstractSession session)
public Expression buildPrimaryKeyExpressionFromObject(java.lang.Object domainObject, AbstractSession session)
public AbstractRecord buildRow(java.lang.Object object, AbstractSession session, DatabaseMapping.WriteType writeType)
public AbstractRecord buildRow(AbstractRecord databaseRow, java.lang.Object object, AbstractSession session, DatabaseMapping.WriteType writeType)
public AbstractRecord buildRowForShallowInsert(java.lang.Object object, AbstractSession session)
public AbstractRecord buildRowForShallowInsert(AbstractRecord databaseRow, java.lang.Object object, AbstractSession session)
public AbstractRecord buildRowForUpdateAfterShallowInsert(java.lang.Object object, AbstractSession session, DatabaseTable table)
public AbstractRecord buildRowForUpdateAfterShallowInsert(AbstractRecord databaseRow, java.lang.Object object, AbstractSession session, DatabaseTable table)
public AbstractRecord buildRowForUpdateBeforeShallowDelete(java.lang.Object object, AbstractSession session, DatabaseTable table)
public AbstractRecord buildRowForUpdateBeforeShallowDelete(AbstractRecord databaseRow, java.lang.Object object, AbstractSession session, DatabaseTable table)
public AbstractRecord buildRowWithChangeSet(AbstractRecord databaseRow, ObjectChangeSet objectChangeSet, AbstractSession session, DatabaseMapping.WriteType writeType)
public AbstractRecord buildRowForTranslation(java.lang.Object object, AbstractSession session)
public AbstractRecord buildRowForUpdate(WriteObjectQuery query)
public AbstractRecord buildRowForUpdate(AbstractRecord databaseRow, WriteObjectQuery query)
public AbstractRecord buildRowForUpdateWithChangeSet(WriteObjectQuery query)
public AbstractRecord buildRowForWhereClause(ObjectLevelModifyQuery query)
public AbstractRecord writeIntoRowFromPrimaryKeyValues(AbstractRecord row, java.lang.Object primaryKey, AbstractSession session, boolean convert)
public AbstractRecord buildRowFromPrimaryKeyValues(java.lang.Object key, AbstractSession session)
public AbstractRecord buildTemplateInsertRow(AbstractSession session)
public void buildTemplateInsertRow(AbstractSession session, AbstractRecord databaseRow)
public void trimFieldsForInsert(AbstractSession session, AbstractRecord databaseRow)
public AbstractRecord buildTemplateUpdateRow(AbstractSession session)
public Expression buildUpdateExpression(DatabaseTable table, AbstractRecord transactionRow, AbstractRecord modifyRow)
public void buildPrimaryKeyAttributesIntoObject(java.lang.Object original, AbstractRecord databaseRow, ObjectBuildingQuery query, AbstractSession session) throws DatabaseException, QueryException
DatabaseException
QueryException
public void buildAttributesIntoShallowObject(java.lang.Object original, AbstractRecord databaseRow, ObjectBuildingQuery query) throws DatabaseException, QueryException
DatabaseException
QueryException
public void buildAttributesIntoWorkingCopyClone(java.lang.Object clone, CacheKey sharedCacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, UnitOfWorkImpl unitOfWork, boolean forRefresh) throws DatabaseException, QueryException
DatabaseException
QueryException
public java.lang.Object buildObjectFromResultSet(ObjectBuildingQuery query, JoinedAttributeManager joinManager, java.sql.ResultSet resultSet, AbstractSession executionSession, DatabaseAccessor accessor, java.sql.ResultSetMetaData metaData, DatabasePlatform platform, java.util.Vector fieldsList, DatabaseField[] fieldsArray) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object clone()
clone
in class java.lang.Object
public void cascadePerformRemove(java.lang.Object object, UnitOfWorkImpl uow, java.util.Map visitedObjects)
public void cascadePerformRemovePrivateOwnedObjectFromChangeSet(java.lang.Object object, UnitOfWorkImpl uow, java.util.Map visitedObjects)
public void cacheForeignKeyValues(AbstractRecord databaseRecord, CacheKey cacheKey, AbstractSession session)
public void cacheForeignKeyValues(java.lang.Object source, CacheKey cacheKey, ClassDescriptor descriptor, AbstractSession session)
public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, UnitOfWorkImpl uow, java.util.Set cascadeErrors)
public void cascadeRegisterNewForCreate(java.lang.Object object, UnitOfWorkImpl uow, java.util.Map visitedObjects)
public ObjectChangeSet compareForChange(java.lang.Object clone, java.lang.Object backUp, UnitOfWorkChangeSet changeSet, AbstractSession session)
public boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, AbstractSession session)
public void copyInto(java.lang.Object source, java.lang.Object target, boolean cloneOneToOneValueHolders)
public void copyInto(java.lang.Object source, java.lang.Object target)
public java.lang.Object copyObject(java.lang.Object original, CopyGroup copyGroup)
public ObjectChangeSet createObjectChangeSet(java.lang.Object clone, UnitOfWorkChangeSet uowChangeSet, AbstractSession session)
clone
- the object to convert to a changeSet.uowChangeSet
- the owner of this changeSet.public ObjectChangeSet createObjectChangeSet(java.lang.Object clone, UnitOfWorkChangeSet uowChangeSet, boolean isNew, AbstractSession session)
clone
- the object to convert to a changeSet.uowChangeSet
- the owner of this changeSet.isNew
- signifies if the clone object is a new object.public ObjectChangeSet createObjectChangeSet(java.lang.Object clone, UnitOfWorkChangeSet uowChangeSet, boolean isNew, boolean assignPrimaryKeyIfExisting, AbstractSession session)
clone
- the object to convert to a changeSet.uowChangeSet
- the owner of this changeSet.isNew
- signifies if the clone object is a new object.assignPrimaryKeyIfExisting
- signifies if the primary key of the change set should be updated if existing.public void createPrimaryKeyExpression(AbstractSession session)
public java.lang.Object extractPrimaryKeyFromExpression(boolean requiresExactMatch, Expression expression, AbstractRecord translationRow, AbstractSession session)
public boolean isPrimaryKeyExpression(boolean requiresExactMatch, Expression expression, AbstractSession session)
public java.lang.Object extractPrimaryKeyFromObject(java.lang.Object domainObject, AbstractSession session)
extractPrimaryKeyFromObject
in class CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping>
public java.lang.Object extractPrimaryKeyFromObject(java.lang.Object domainObject, AbstractSession session, boolean shouldReturnNullIfNull)
public java.lang.Object extractPrimaryKeyFromRow(AbstractRecord databaseRow, AbstractSession session)
public AbstractRecord extractPrimaryKeyRowFromExpression(Expression expression, AbstractRecord translationRow, AbstractSession session)
public AbstractRecord extractRowFromExpression(Expression expression, AbstractRecord translationRow, AbstractSession session)
public AbstractRecord extractPrimaryKeyRowFromObject(java.lang.Object domainObject, AbstractSession session)
public java.lang.Object extractValueFromObjectForField(java.lang.Object domainObject, DatabaseField field, AbstractSession session) throws DescriptorException
DescriptorException
public void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)
public ChangeRecord getBaseChangeRecordForField(ObjectChangeSet objectChangeSet, java.lang.Object object, DatabaseField databaseField, AbstractSession session)
public DatabaseMapping getBaseMappingForField(DatabaseField databaseField)
public java.lang.Object getBaseValueForField(DatabaseField databaseField, java.lang.Object domainObject)
public ClassDescriptor getDescriptor()
public java.lang.Class getFieldClassification(DatabaseField fieldToClassify) throws DescriptorException
DescriptorException
public DatabaseField getFieldForQueryKeyName(java.lang.String name)
public java.util.Map<DatabaseField,DatabaseField> getFieldsMap()
public java.util.List<DatabaseMapping> getCloningMappings()
public boolean isSimple()
public java.util.List<DatabaseMapping> getRelationshipMappings()
public java.util.List<DatabaseMapping> getEagerMappings()
public java.util.List<DatabaseMapping> getJoinedAttributes()
public java.util.List<DatabaseMapping> getBatchFetchedAttributes()
public AbstractDirectMapping getSequenceMapping()
public void setSequenceMapping(AbstractDirectMapping sequenceMapping)
public boolean hasJoinedAttributes()
public boolean hasBatchFetchedAttributes()
public boolean hasInBatchFetchedAttribute()
public void setHasInBatchFetchedAttribute(boolean hasInBatchFetchedAttribute)
public DatabaseMapping getMappingForAttributeName(java.lang.String name)
public DatabaseMapping getMappingForField(DatabaseField field)
getMappingForField
in class CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping>
public java.util.List<DatabaseMapping> getReadOnlyMappingsForField(DatabaseField field)
public java.util.Map<DatabaseField,DatabaseMapping> getMappingsByField()
public java.util.Map<DatabaseField,java.util.List<DatabaseMapping>> getReadOnlyMappingsByField()
public java.lang.Object getParentObjectForField(DatabaseField databaseField, java.lang.Object domainObject)
public java.util.List<java.lang.Class> getPrimaryKeyClassifications()
public Expression getPrimaryKeyExpression()
public java.util.List<DatabaseMapping> getPrimaryKeyMappings()
public DatabaseField getTargetFieldForQueryKeyName(java.lang.String queryKeyName)
public void initialize(AbstractSession session) throws DescriptorException
DescriptorException
public boolean isPrimaryKeyComponentInvalid(java.lang.Object keyValue, int index)
public void recordPrivateOwnedRemovals(java.lang.Object object, UnitOfWorkImpl uow, boolean initialPass)
public void postInitialize(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.
public void initializeBatchFetchedAttributes()
By caching the result query execution in the case where there are no batch fetched attributes can be improved.
public void initializePrimaryKey(AbstractSession session) throws DescriptorException
DescriptorException
public java.lang.Object instantiateClone(java.lang.Object domainObject, AbstractSession session)
public java.lang.Object instantiateWorkingCopyClone(java.lang.Object domainObject, AbstractSession session)
public java.lang.Object instantiateWorkingCopyCloneFromRow(AbstractRecord row, ObjectBuildingQuery query, java.lang.Object primaryKey, UnitOfWorkImpl unitOfWork)
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(java.lang.Object target, ObjectChangeSet changeSet, java.lang.Object source, MergeManager mergeManager, AbstractSession targetSession)
public void mergeChangesIntoObject(java.lang.Object target, ObjectChangeSet changeSet, java.lang.Object source, MergeManager mergeManager, AbstractSession targetSession, boolean isTargetCloneOfOriginal, boolean shouldMergeFetchGroup)
public void mergeIntoObject(java.lang.Object target, boolean isUnInitialized, java.lang.Object source, MergeManager mergeManager, AbstractSession targetSession)
public void mergeIntoObject(java.lang.Object target, ObjectChangeSet changeSet, boolean isUnInitialized, java.lang.Object source, MergeManager mergeManager, AbstractSession targetSession, boolean cascadeOnly, boolean isTargetCloneOfOriginal, boolean shouldMergeFetchGroup)
public void populateAttributesForClone(java.lang.Object original, CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, AbstractSession cloningSession)
public void rehashFieldDependancies(AbstractSession session)
public void setDescriptor(ClassDescriptor aDescriptor)
public void setMappingsByField(java.util.Map<DatabaseField,DatabaseMapping> theFieldMappings)
public void setReadOnlyMappingsByField(java.util.Map<DatabaseField,java.util.List<DatabaseMapping>> theReadOnlyFieldMappings)
public void setPrimaryKeyClassifications(java.util.List<java.lang.Class> primaryKeyClassifications)
public void setPrimaryKeyExpression(Expression criteria)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object unwrapObject(java.lang.Object proxy, AbstractSession session)
public void updateCachedAttributes(PersistenceEntity persistenceEntity, CacheKey cacheKey, java.lang.Object primaryKey)
public void validate(AbstractSession session) throws DescriptorException
DescriptorException
public boolean verifyDelete(java.lang.Object object, AbstractSession session)
public boolean hasWrapperPolicy()
public void setHasWrapperPolicy(boolean hasWrapperPolicy)
public java.lang.Object wrapObject(java.lang.Object implementation, AbstractSession session)
public boolean isXMLObjectBuilder()
public java.lang.String getLockAttribute()
public boolean shouldKeepRow()
public boolean hasCacheIndexesInSopObject()
public AbstractRecord createRecordFromXMLContext(XMLContext context)
CoreObjectBuilder
createRecordFromXMLContext
in class CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping>
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference