java.lang.Object
java.lang.Record
io.john.amiscaray.quak.data.update.FieldUpdate<T>
- Type Parameters:
T- The entity class this applies to.- Record Components:
fieldName- The name of the field to update.updates- The changes made to the value of the field.
A class representing a single database update operation. Often used with the static methods of
UpdateExpression for semantic field updates:
import static io.john.amiscaray.quak.data.update.UpdateExpression.*;
public class Test {
public void test() {
dbProxy.updateAll(Employee.class,
FieldUpdate.<Number>forField("salary")
.apply(multiply(1.5))
.apply(add(2000))
.build()
);
}
}-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFieldUpdate(String fieldName, List<UpdateExpression<T>> updates) Creates an instance of aFieldUpdaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldNamerecord component.static <T> FieldUpdate.FieldUpdateBuilder<T> Creates a builder for a field with a given name.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.updates()Returns the value of theupdatesrecord component.
-
Constructor Details
-
Method Details
-
forField
Creates a builder for a field with a given name.- Type Parameters:
T- The type of the field being updated.- Parameters:
fieldName- The name of the field to update.- Returns:
- A builder for a field update.
-
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). -
fieldName
Returns the value of thefieldNamerecord component.- Returns:
- the value of the
fieldNamerecord component
-
updates
Returns the value of theupdatesrecord component.- Returns:
- the value of the
updatesrecord component
-