Package org.apache.cayenne
Class CayenneDataObject
java.lang.Object
org.apache.cayenne.PersistentObject
org.apache.cayenne.BaseDataObject
org.apache.cayenne.CayenneDataObject
- All Implemented Interfaces:
- Serializable,- DataObject,- Persistent,- Validating
public class CayenneDataObject extends BaseDataObject
Implementation of 
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.
- See Also:
- BaseDataObject,- HybridDataObject, Serialized Form
- 
Field SummaryFields inherited from class org.apache.cayenne.BaseDataObjectsnapshotVersionFields inherited from class org.apache.cayenne.PersistentObjectobjectContext, objectId, persistenceStateFields inherited from interface org.apache.cayenne.DataObjectDEFAULT_VERSION
- 
Constructor SummaryConstructors Constructor Description CayenneDataObject()
- 
Method SummaryModifier and Type Method Description protected voidappendProperties(StringBuffer buffer)static StringmakePath(String... pathParts)Deprecated.ObjectreadPropertyDirectly(String propName)Returns mapped property value as curently stored in the DataObject.protected voidreadState(ObjectInputStream in)voidsetPersistenceState(int persistenceState)voidwritePropertyDirectly(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 voidwriteState(ObjectOutputStream out)Methods inherited from class org.apache.cayenne.BaseDataObjectaddToManyTarget, beforePropertyRead, beforePropertyWrite, getSnapshotVersion, readNestedProperty, readProperty, readSerialized, removeToManyTarget, setObjectContext, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toString, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writeSerializedMethods inherited from class org.apache.cayenne.PersistentObjectgetMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectIdMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cayenne.PersistentgetObjectContext, getObjectId, getPersistenceState, setObjectId
- 
Field Details- 
values
 
- 
- 
Constructor Details- 
CayenneDataObjectpublic CayenneDataObject()
 
- 
- 
Method Details- 
setPersistenceStatepublic void setPersistenceState(int persistenceState)- Specified by:
- setPersistenceStatein interface- Persistent
- Overrides:
- setPersistenceStatein class- BaseDataObject
 
- 
readPropertyDirectlyDescription copied from interface:DataObjectReturns mapped property value as curently stored in the DataObject. Returned value maybe a fault or a real value. This method will not attempt to resolve faults, or to read unmapped properties.- Specified by:
- readPropertyDirectlyin interface- DataObject
- Overrides:
- readPropertyDirectlyin class- BaseDataObject
 
- 
writePropertyDirectlyDescription copied from interface:DataObjectModifies a value of a named property without altering the object state in any way, and without triggering any database operations. This method is intended mostly for internal use by Cayenne framework, and shouldn't be called from the application code.- Specified by:
- writePropertyDirectlyin interface- DataObject
- Overrides:
- writePropertyDirectlyin class- BaseDataObject
 
- 
appendProperties- Overrides:
- appendPropertiesin class- BaseDataObject
 
- 
readState- Overrides:
- readStatein class- BaseDataObject
- Throws:
- IOException
- ClassNotFoundException
 
- 
writeState- Overrides:
- writeStatein class- BaseDataObject
- Throws:
- IOException
 
- 
makePathDeprecated.since 4.1, useCayenne.makePath(String...)insteadConvenience method to invokeCayenne.makePath(String...)from within a DataObject subclass to create a dotted path using the generated string constants for attributes and relationships.- Since:
- 3.1
- See Also:
- Cayenne.makePath(String...)
 
 
- 
Cayenne.makePath(String...)instead