java.lang.Object
java.lang.Record
org.litebridgedb.db.spi.update.Update
- Record Components:
table-TableMetaDataprovides metadata about the table being updated, including its structure.columnValues- TheColumnValuepairs a column with its new value, ensuring clear definition of updates.where- TheConditionobjects define filter criteria that determine which rows of the table will be updated.
- All Implemented Interfaces:
UpdateStatement
public record Update(Table table, List<ColumnValue> columnValues, List<Condition> where)
extends Record
implements UpdateStatement
A SQL UPDATE statement targeting a specific table, with associated column values and conditions.
This class is a record that combines:
- A target TableMetaData representing the table to update.
- A list of ColumnValue objects specifying the columns and their new values.
- A list of Condition objects that define the WHERE clause conditions for the update operation.
This class is immutable and serves as part of the structure for creating and representing SQL UPDATE operations in a database context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecolumnValuesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.table()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.where()Returns the value of thewhererecord component.
-
Constructor Details
-
Update
Creates an instance of aUpdaterecord class.- Parameters:
table- the value for thetablerecord componentcolumnValues- the value for thecolumnValuesrecord componentwhere- the value for thewhererecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
table
Returns the value of thetablerecord component.- Specified by:
tablein interfaceUpdateStatement- Returns:
- the value of the
tablerecord component
-
columnValues
Returns the value of thecolumnValuesrecord component.- Returns:
- the value of the
columnValuesrecord component
-
where
Returns the value of thewhererecord component.- Returns:
- the value of the
whererecord component
-