|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.apache.cayenne.DataRow
public class DataRow
DataRow a map that holds values retrieved from the database for a given query row. DataRows are used to cache raw database data and as a reference point for tracking DataObject changes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary | |
---|---|
protected String |
entityName
|
protected long |
replacesVersion
|
protected long |
version
|
Constructor Summary | |
---|---|
DataRow(int initialCapacity)
|
|
DataRow(Map<String,?> map)
|
Method Summary | |
---|---|
DataRow |
applyDiff(DataRow diff)
Builds a new DataRow, merging changes from diff parameter with data
contained in this DataRow. |
DataRow |
createDiff(DataRow row)
Creates a DataRow that contains only the keys that have values that differ between this object and row parameter. |
ObjectId |
createObjectId(ObjEntity entity)
Deprecated. since 3.0 - unused |
ObjectId |
createObjectId(String entityName,
DbEntity entity)
Deprecated. since 3.0 - unused. |
ObjectId |
createObjectId(String entityName,
DbEntity entity,
String namePrefix)
Deprecated. since 3.0 - unused. |
ObjectId |
createTargetObjectId(String entityName,
DbRelationship relationship)
Returns an ObjectId of an object on the other side of the to-one relationship, for this DataRow representing a source of relationship. |
String |
getEntityName()
|
long |
getReplacesVersion()
|
long |
getVersion()
|
void |
setEntityName(String entityName)
|
void |
setReplacesVersion(long replacesVersion)
Sets the version of DataRow replaced by this one in the store. |
String |
toString()
|
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected long version
protected long replacesVersion
protected String entityName
Constructor Detail |
---|
public DataRow(Map<String,?> map)
public DataRow(int initialCapacity)
Method Detail |
---|
public long getVersion()
public long getReplacesVersion()
public void setReplacesVersion(long replacesVersion)
public DataRow applyDiff(DataRow diff)
diff
parameter with data
contained in this DataRow.
public DataRow createDiff(DataRow row)
row
parameter. Diff values are taken from the
row
parameter. It is assumed that key sets are compatible in both rows
(e.g. they represent snapshots for the same entity). Returns null if no differences
are found.
public ObjectId createObjectId(ObjEntity entity)
public ObjectId createObjectId(String entityName, DbEntity entity)
public ObjectId createTargetObjectId(String entityName, DbRelationship relationship)
public ObjectId createObjectId(String entityName, DbEntity entity, String namePrefix)
Prefixing is useful when extracting an ObjectId of a target row from a row obtained via prefetching. namePrefix must omit the "db:" prefix and must end with ".", e.g. "TO_ARTIST.PAINTING_ARRAY."
public String toString()
toString
in class AbstractMap<String,Object>
public String getEntityName()
public void setEntityName(String entityName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |