Package org.apache.cayenne
Class DataRow
- All Implemented Interfaces:
- Serializable,- Cloneable,- Map<String,Object>
public class DataRow extends HashMap<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:
- Serialized Form
- 
Nested Class SummaryNested classes/interfaces inherited from class java.util.AbstractMapAbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
- 
Field SummaryFields Modifier and Type Field Description protected StringentityNameprotected longreplacesVersionprotected longversion
- 
Constructor Summary
- 
Method SummaryModifier and Type Method Description DataRowapplyDiff(DataRow diff)Builds a new DataRow, merging changes fromdiffparameter with data contained in this DataRow.DataRowcreateDiff(DataRow row)Creates a DataRow that contains only the keys that have values that differ between this object androwparameter.ObjectIdcreateTargetObjectId(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.StringgetEntityName()longgetReplacesVersion()longgetVersion()voidsetEntityName(String entityName)voidsetReplacesVersion(long replacesVersion)Sets the version of DataRow replaced by this one in the store.StringtoString()Methods inherited from class java.util.HashMapclear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMapequals, hashCode
- 
Field Details- 
versionprotected long version
- 
replacesVersionprotected long replacesVersion
- 
entityName- Since:
- 3.0
 
 
- 
- 
Constructor Details- 
DataRow
- 
DataRowpublic DataRow(int initialCapacity)
 
- 
- 
Method Details- 
getVersionpublic long getVersion()
- 
getReplacesVersionpublic long getReplacesVersion()
- 
setReplacesVersionpublic void setReplacesVersion(long replacesVersion)Sets the version of DataRow replaced by this one in the store.
- 
applyDiffBuilds a new DataRow, merging changes fromdiffparameter with data contained in this DataRow.
- 
createDiffCreates a DataRow that contains only the keys that have values that differ between this object androwparameter. Diff values are taken from therowparameter. 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.
- 
createTargetObjectIdReturns 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:
- toStringin class- AbstractMap<String,Object>
 
- 
getEntityName- Since:
- 3.0
 
- 
setEntityName- Since:
- 3.0
 
 
-