Record Class ManualUpsert

java.lang.Object
java.lang.Record
org.litebridge.orm.persistence.ManualUpsert
All Implemented Interfaces:
StatementBuilder

public record ManualUpsert(org.litebridge.orm.persistence.UpdateBuilder updateBuilder, org.litebridge.orm.persistence.InsertBuilder insertBuilder) extends Record implements StatementBuilder
  • Constructor Details

    • ManualUpsert

      public ManualUpsert(org.litebridge.orm.persistence.UpdateBuilder updateBuilder, org.litebridge.orm.persistence.InsertBuilder insertBuilder)
      Creates an instance of a ManualUpsert record class.
      Parameters:
      updateBuilder - the value for the updateBuilder record component
      insertBuilder - the value for the insertBuilder record component
  • Method Details

    • dto

      public Object dto()
      Specified by:
      dto in interface StatementBuilder
    • node

      public QueryNode node()
      Description copied from interface: StatementBuilder
      Returns the current query node.
      Specified by:
      node in interface StatementBuilder
      Returns:
      the query node
    • nodeHash

      public int nodeHash()
      Description copied from interface: StatementBuilder
      Returns a cached copy of the AST node hash.
      Specified by:
      nodeHash in interface StatementBuilder
      Returns:
      the cached AST node hash
    • statementChain

      public StatementChain statementChain()
      Description copied from interface: StatementBuilder
      Returns the chain of statements built so far.
      Specified by:
      statementChain in interface StatementBuilder
      Returns:
      The statement chain.
    • createUpdateMetaData

      public UpdateMetaData createUpdateMetaData(PreparedOperation preparedOperation)
      Description copied from interface: StatementBuilder
      Creates the update metadata for the statement.
      Specified by:
      createUpdateMetaData in interface StatementBuilder
      Parameters:
      preparedOperation - the prepared database operation
      Returns:
      the update metadata
    • setField

      public void setField(String fieldName, @Nullable Object value)
      Description copied from interface: StatementBuilder
      Sets a field value on the statement.
      Specified by:
      setField in interface StatementBuilder
      Parameters:
      fieldName - the name of the field to set
      value - the value to set
    • build

      public PreparedOperation build()
      Description copied from interface: StatementBuilder
      Builds the final SQL statement.
      Specified by:
      build in interface StatementBuilder
      Returns:
      The built statement.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • updateBuilder

      public org.litebridge.orm.persistence.UpdateBuilder updateBuilder()
      Returns the value of the updateBuilder record component.
      Returns:
      the value of the updateBuilder record component
    • insertBuilder

      public org.litebridge.orm.persistence.InsertBuilder insertBuilder()
      Returns the value of the insertBuilder record component.
      Returns:
      the value of the insertBuilder record component