DataObject (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne, interface: DataObject

# Interface DataObject

All Superinterfaces:
  `Persistent, Serializable`

@Deprecated(since="5.0", forRemoval=true) public interface DataObject extends Persistent
Deprecated, for removal: This API element is subject to removal in a future version.
since 5.0, use `Persistent` interface directly
Defines basic methods for a persistent object in Cayenne.

- ## Field Summary

  ### Fields inherited from interface Persistent

  `DEFAULT_VERSION`
  Modifier and Type
  Field
  Description
  `static final long`
  `DEFAULT_VERSION`

- ## Method Summary

  ### Methods inherited from interface Persistent

  `addToManyTarget, getObjectContext, getObjectId, getPersistenceState, getSnapshotVersion, readNestedProperty, readNestedProperty, readProperty, readPropertyDirectly, removeToManyTarget, setObjectContext, setObjectId, setPersistenceState, setSnapshotVersion, setToOneTarget, writeProperty, writePropertyDirectly`
  Modifier and Type
  Method
  Description
  `void`
  `addToManyTarget(String relationshipName, Persistent target, boolean setReverse)`
  Adds an object to a to-many relationship.
  `ObjectContext`
  `getObjectContext()`
  `ObjectId`
  `getObjectId()`
  `int`
  `getPersistenceState()`
  `long`
  `getSnapshotVersion()`
  Returns a version of a DataRow snapshot that was used to create this object.
  `Object`
  `readNestedProperty(String path)`
  Returns a value of the property identified by a property path.
  `Object`
  `readNestedProperty(CayennePath path)`
  Returns a value of the property identified by a property path.
  `Object`
  `readProperty(String propName)`
  Returns a value of the property identified by propName.
  `Object`
  `readPropertyDirectly(String propertyName)`
  Returns mapped property value as currently stored in the Persistent object.
  `void`
  `removeToManyTarget(String relationshipName, Persistent target, boolean unsetReverse)`
  Removes an object from a to-many relationship.
  `void`
  `setObjectContext(ObjectContext objectContext)`
  `void`
  `setObjectId(ObjectId id)`
  `void`
  `setPersistenceState(int state)`
  `void`
  `setSnapshotVersion(long snapshotVersion)`
  `void`
  `setToOneTarget(String relationshipName, Persistent value, boolean setReverse)`
  Sets to-one relationship to a new value.
  `void`
  `writeProperty(String propertyName, Object value)`
  Sets the property to the new value.
  `void`
  `writePropertyDirectly(String propertyName, Object val)`
  Modifies a value of a named property without altering the object state in any way, and without triggering any database operations.