public class HybridDataObject extends BaseDataObject
CayenneDataObject uses Map to store generic attributes,
only difference is that this Map will be created lazily at first write, thus reducing memory penalty if possible.
This class can be used as superclass for objects that have attributes created at runtime.
If generic runtime attributes will be used always it may be a good idea to use CayenneDataObject instead.
If you don't create attributes at runtime it is better to use BaseDataObject class.
Map creation is not thread safe, as DataObject in general not thread safe by it's own.
BaseDataObject,
CayenneDataObject,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
values |
snapshotVersionobjectContext, objectId, persistenceStateDEFAULT_VERSION| Constructor and Description |
|---|
HybridDataObject() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendProperties(StringBuffer buffer) |
Object |
readPropertyDirectly(String propName)
Returns mapped property value as curently stored in the DataObject.
|
protected void |
readState(ObjectInputStream in) |
void |
writePropertyDirectly(String propName,
Object val)
Modifies a value of a named property without altering the object state in any way,
and without triggering any database operations.
|
protected void |
writeState(ObjectOutputStream out) |
addToManyTarget, beforePropertyRead, beforePropertyWrite, getSnapshotVersion, readNestedProperty, readProperty, readSerialized, removeToManyTarget, setObjectContext, setPersistenceState, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toString, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writeSerializedgetMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetObjectContext, getObjectId, getPersistenceState, setObjectIdpublic Object readPropertyDirectly(String propName)
DataObjectreadPropertyDirectly in interface DataObjectreadPropertyDirectly in class BaseDataObjectpublic void writePropertyDirectly(String propName, Object val)
DataObjectwritePropertyDirectly in interface DataObjectwritePropertyDirectly in class BaseDataObjectprotected void appendProperties(StringBuffer buffer)
appendProperties in class BaseDataObjectprotected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException
readState in class BaseDataObjectIOExceptionClassNotFoundExceptionprotected void writeState(ObjectOutputStream out) throws IOException
writeState in class BaseDataObjectIOExceptionCopyright © 2001–2020 Apache Cayenne. All rights reserved.