|
||||||||||
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
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.
Field Summary | |
---|---|
protected long |
replacesVersion
|
protected long |
version
|
Constructor Summary | |
---|---|
DataRow(int initialCapacity)
|
|
DataRow(Map 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)
Creates an ObjectId from the values in the snapshot. |
ObjectId |
createObjectId(String entityName,
DbEntity entity)
|
ObjectId |
createObjectId(String entityName,
DbEntity entity,
String namePrefix)
Extracts PK columns prefixed with some path. |
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. |
long |
getReplacesVersion()
|
long |
getVersion()
|
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
Constructor Detail |
---|
public DataRow(Map 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |