Package org.apache.cayenne
Class PersistentObject
- java.lang.Object
-
- org.apache.cayenne.PersistentObject
-
- All Implemented Interfaces:
Serializable,Persistent
- Direct Known Subclasses:
BaseDataObject
public abstract class PersistentObject extends Object implements Persistent
A convenience base superclass for concrete Persistent objects. Provides implementation of properties declared in Persistent interface.POJO Note
If having PersistentObject as a superclass presents a problem in an application, source code of this class can be copied verbatim to a custom class generation template. Desired superclass can be set in CayenneModeler.
- Since:
- 1.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectContextobjectContextprotected ObjectIdobjectIdprotected intpersistenceState
-
Constructor Summary
Constructors Constructor Description PersistentObject()Creates a new transient object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectgetMapKey(String relationshipName, Object value)Returns a map key for a given to-many map relationship and a target object.ObjectContextgetObjectContext()ObjectIdgetObjectId()intgetPersistenceState()voidsetObjectContext(ObjectContext objectContext)voidsetObjectId(ObjectId objectId)voidsetPersistenceState(int persistenceState)StringtoString()
-
-
-
Field Detail
-
objectId
protected ObjectId objectId
-
persistenceState
protected int persistenceState
-
objectContext
protected transient ObjectContext objectContext
-
-
Method Detail
-
getPersistenceState
public int getPersistenceState()
- Specified by:
getPersistenceStatein interfacePersistent
-
setPersistenceState
public void setPersistenceState(int persistenceState)
- Specified by:
setPersistenceStatein interfacePersistent
-
getObjectContext
public ObjectContext getObjectContext()
- Specified by:
getObjectContextin interfacePersistent
-
setObjectContext
public void setObjectContext(ObjectContext objectContext)
- Specified by:
setObjectContextin interfacePersistent
-
getObjectId
public ObjectId getObjectId()
- Specified by:
getObjectIdin interfacePersistent
-
setObjectId
public void setObjectId(ObjectId objectId)
- Specified by:
setObjectIdin interfacePersistent
-
getMapKey
protected Object getMapKey(String relationshipName, Object value)
Returns a map key for a given to-many map relationship and a target object.- Since:
- 3.0
-
-