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

# Class BaseDataObject

java.lang.Object
org.apache.cayenne.PersistentObject
org.apache.cayenne.BaseDataObject

All Implemented Interfaces:
  `Serializable, Persistent, Validating`

@Deprecated(since="5.0", forRemoval=true) public abstract class BaseDataObject extends PersistentObject implements Persistent, Validating
Deprecated, for removal: This API element is subject to removal in a future version.
since 5.0, use `PersistentObject` directly
Deprecated base implementation of `Persistent` objects.

Since:
  4.1
See Also:
  - `PersistentObject`
  - `GenericPersistentObject`
  - `HybridPersistentObject`
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class PersistentObject

  `objectContext, objectId, persistenceState, snapshotVersion`
  Modifier and Type
  Field
  Description
  `protected ObjectContext`
  `objectContext`
  `protected ObjectId`
  `objectId`
  `protected int`
  `persistenceState`
  `protected long`
  `snapshotVersion`

  ### Fields inherited from interface Persistent

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BaseDataObject()`
  Deprecated, for removal: This API element is subject to removal in a future version.

- ## Method Summary

  ### Methods inherited from class PersistentObject

  `addToManyTarget, appendProperties, beforePropertyRead, beforePropertyWrite, getMapKey, getObjectContext, getObjectId, getPersistenceState, getSnapshotVersion, readNestedProperty, readNestedProperty, readProperty, readPropertyDirectly, readSerialized, readState, removeToManyTarget, setObjectContext, setObjectId, setPersistenceState, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toString, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writePropertyDirectly, writeSerialized, writeState`
  Modifier and Type
  Method
  Description
  `void`
  `addToManyTarget(String relName, Persistent value, boolean setReverse)`
  Adds an object to a to-many relationship.
  `protected void`
  `appendProperties(StringBuffer buffer)`
  `protected void`
  `beforePropertyRead(String propName)`
  `protected void`
  `beforePropertyWrite(String propName, Object oldValue, Object newValue)`
  `protected Object`
  `getMapKey(String relationshipName, Object value)`
  Returns a map key for a given to-many map relationship and a target object.
  `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 propertyName)`
  Returns a value of the property identified by propName.
  `Object`
  `readPropertyDirectly(String propName)`
  Returns mapped property value as currently stored in the Persistent object.
  `protected void`
  `readSerialized(ObjectInputStream in)`
  `protected void`
  `readState(ObjectInputStream in)`
  `void`
  `removeToManyTarget(String relName, Persistent value, boolean setReverse)`
  Removes an object from a to-many relationship.
  `void`
  `setObjectContext(ObjectContext objectContext)`
  `void`
  `setObjectId(ObjectId objectId)`
  `void`
  `setPersistenceState(int persistenceState)`
  `protected void`
  `setReverseRelationship(String relName, Persistent val)`
  Initializes reverse relationship from object `val` to this object.
  `void`
  `setSnapshotVersion(long snapshotVersion)`
  `List<? extends Persistent>`
  `setToManyTarget(String relName, Collection<? extends Persistent> values, boolean setReverse)`
  Sets the relationships to the specified `Persistent` objects.
  `void`
  `setToOneTarget(String relationshipName, Persistent value, boolean setReverse)`
  Sets to-one relationship to a new value.
  `String`
  `toString()`
  `StringBuffer`
  `toStringBuffer(StringBuffer buffer, boolean fullDesc)`
  A variation of "toString" method, that may be more efficient in some cases.
  `protected void`
  `unsetReverseRelationship(String relName, Persistent val)`
  Removes current object from reverse relationship of object `val` to this object.
  `void`
  `validateForDelete(ValidationResult validationResult)`
  This implementation does nothing.
  `void`
  `validateForInsert(ValidationResult validationResult)`
  Calls `PersistentObject.validateForSave(ValidationResult)`.
  `protected void`
  `validateForSave(ValidationResult validationResult)`
  Performs property validation of the object, appending any validation failures to the provided validationResult object.
  `void`
  `validateForUpdate(ValidationResult validationResult)`
  Calls `PersistentObject.validateForSave(ValidationResult)`.
  `protected void`
  `willConnect(String relationshipName, Persistent object)`
  Called before establishing a relationship with another object.
  `void`
  `writeProperty(String propName, Object val)`
  Sets the property to the new value.
  `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`
  `writeSerialized(ObjectOutputStream out)`
  `protected void`
  `writeState(ObjectOutputStream out)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BaseDataObject

    public BaseDataObject()
    Deprecated, for removal: This API element is subject to removal in a future version.