public abstract class PersistentObject extends Object implements Persistent
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.
| Modifier and Type | Field and Description |
|---|---|
protected ObjectContext |
objectContext |
protected ObjectId |
objectId |
protected int |
persistenceState |
| Constructor and Description |
|---|
PersistentObject()
Creates a new transient object.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
ObjEntity |
getObjEntity()
Deprecated.
since 3.1
Cayenne.getObjEntity(Persistent) is used |
int |
getPersistenceState() |
void |
setObjectContext(ObjectContext objectContext) |
void |
setObjectId(ObjectId objectId) |
void |
setPersistenceState(int persistenceState) |
String |
toString() |
protected ObjectId objectId
protected int persistenceState
protected transient ObjectContext objectContext
public int getPersistenceState()
getPersistenceState in interface Persistentpublic void setPersistenceState(int persistenceState)
setPersistenceState in interface Persistentpublic ObjectContext getObjectContext()
getObjectContext in interface Persistentpublic void setObjectContext(ObjectContext objectContext)
setObjectContext in interface Persistentpublic ObjectId getObjectId()
getObjectId in interface Persistentpublic void setObjectId(ObjectId objectId)
setObjectId in interface Persistentprotected Object getMapKey(String relationshipName, Object value)
@Deprecated public ObjEntity getObjEntity()
Cayenne.getObjEntity(Persistent) is usedCopyright © 2001–2018 Apache Cayenne. All rights reserved.