Record Class ScalarResultSegment
java.lang.Object
java.lang.Record
org.apache.cayenne.query.ScalarResultSegment
- Record Components:
column- the ResultSet column labeltype- the Java type the column value is converted to, or null when the segment declares none and the value is read with the type determined for the column by the query (a SQLTemplate "#result" directive, or the type the driver reports)columnOffset- a zero-based column index of this segment's column in the ResultSet
- All Implemented Interfaces:
ResultSegment
public record ScalarResultSegment(String column, Class<?> type, int columnOffset)
extends Record
implements ResultSegment
A result set segment mapped to a single scalar value.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionScalarResultSegment(String column, Class<?> type, int columnOffset) Creates an instance of aScalarResultSegmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumn()Returns the value of thecolumnrecord component.intReturns the value of thecolumnOffsetrecord 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.Class<?> type()Returns the value of thetyperecord component.
-
Constructor Details
-
ScalarResultSegment
Creates an instance of aScalarResultSegmentrecord class.- Parameters:
column- the value for thecolumnrecord componenttype- the value for thetyperecord componentcolumnOffset- the value for thecolumnOffsetrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
column
-
type
-
columnOffset
public int columnOffset()Returns the value of thecolumnOffsetrecord component.- Specified by:
columnOffsetin interfaceResultSegment- Returns:
- the value of the
columnOffsetrecord component
-