public class CayenneDataObject extends BaseDataObject
DataObject
that uses Map
to store object fields.
This implementation was pre 4.1 default.
Since 4.1 it is recommended to use BaseDataObject
as superclass (and it is actually default now),
as it has better performance and lower memory consumption (much lower for small objects).
You may need to use this class only if you have some generic attributes created at runtime (also
consider HybridDataObject
in this case) or if any compatibility issues arise.
BaseDataObject
,
HybridDataObject
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
values |
snapshotVersion
objectContext, objectId, persistenceState
DEFAULT_VERSION
Constructor and Description |
---|
CayenneDataObject() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendProperties(StringBuffer buffer) |
static String |
makePath(String... pathParts)
Deprecated.
since 4.1, use
Cayenne.makePath(String...) instead |
Object |
readPropertyDirectly(String propName)
Returns mapped property value as curently stored in the DataObject.
|
protected void |
readState(ObjectInputStream in) |
void |
setPersistenceState(int persistenceState) |
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, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toString, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writeSerialized
getMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getObjectContext, getObjectId, getPersistenceState, setObjectId
public void setPersistenceState(int persistenceState)
setPersistenceState
in interface Persistent
setPersistenceState
in class BaseDataObject
public Object readPropertyDirectly(String propName)
DataObject
readPropertyDirectly
in interface DataObject
readPropertyDirectly
in class BaseDataObject
public void writePropertyDirectly(String propName, Object val)
DataObject
writePropertyDirectly
in interface DataObject
writePropertyDirectly
in class BaseDataObject
protected void appendProperties(StringBuffer buffer)
appendProperties
in class BaseDataObject
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException
readState
in class BaseDataObject
IOException
ClassNotFoundException
protected void writeState(ObjectOutputStream out) throws IOException
writeState
in class BaseDataObject
IOException
@Deprecated public static String makePath(String... pathParts)
Cayenne.makePath(String...)
insteadCayenne.makePath(String...)
from
within a DataObject subclass to create a dotted path using the generated
string constants for attributes and relationships.Cayenne.makePath(String...)
Copyright © 2001–2019 Apache Cayenne. All rights reserved.