Record Class UpdateResult
java.lang.Object
java.lang.Record
org.apache.cayenne.UpdateResult
- All Implemented Interfaces:
QueryResult
A
QueryResult item holding the update counts produced by a non-selecting query. A regular update produces
a single count, while a batch produces one count per batch element.- Since:
- 5.0
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateResult(int[] counts) Creates an instance of aUpdateResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcount()Returns the update count of a non-batch update.int[]counts()Returns the value of thecountsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UpdateResult
public UpdateResult(int[] counts) Creates an instance of aUpdateResultrecord class.- Parameters:
counts- the value for thecountsrecord component
-
-
Method Details
-
count
public int count()Returns the update count of a non-batch update.- Throws:
CayenneRuntimeException- if this item does not contain exactly one count.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
counts
public int[] counts()Returns the value of thecountsrecord component.- Returns:
- the value of the
countsrecord component
-