Package org.apache.cayenne
Class DataRow
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Object>
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.
- Since:
- 1.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBuilds a new DataRow, merging changes fromdiff
parameter with data contained in this DataRow.createDiff
(DataRow row) Creates a DataRow that contains only the keys that have values that differ between this object androw
parameter.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
long
void
setEntityName
(String entityName) void
setReplacesVersion
(long replacesVersion) Sets the version of DataRow replaced by this one in the store.toString()
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode
-
Field Details
-
version
protected long version -
replacesVersion
protected long replacesVersion -
entityName
- Since:
- 3.0
-
-
Constructor Details
-
DataRow
-
DataRow
public DataRow(int initialCapacity)
-
-
Method Details
-
getVersion
public long getVersion() -
getReplacesVersion
public long getReplacesVersion() -
setReplacesVersion
public void setReplacesVersion(long replacesVersion) Sets the version of DataRow replaced by this one in the store. -
applyDiff
Builds a new DataRow, merging changes fromdiff
parameter with data contained in this DataRow. -
createDiff
Creates a DataRow that contains only the keys that have values that differ between this object androw
parameter. Diff values are taken from therow
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. -
createTargetObjectId
Returns an ObjectId of an object on the other side of the to-one relationship, for this DataRow representing a source of relationship. Returns null if snapshot FK columns indicate a null to-one relationship. -
toString
- Overrides:
toString
in classAbstractMap<String,
Object>
-
getEntityName
- Since:
- 3.0
-
setEntityName
- Since:
- 3.0
-