Record Class UpsertResultado

java.lang.Object
java.lang.Record
br.com.vantroba.bi.transporte.processamento.UpsertResultado
Record Components:
enviadas - total de linhas no upload (entrada do método).
inseridas - linhas novas — xmax = 0 no RETURNING.
atualizadas - linhas pré-existentes que mudaram conteúdo — UPDATE in-place (id e posição preservados; xmin é trocado).
removidas - linhas apagadas pelo DELETE seletivo (sumiram do upload neste período).

public record UpsertResultado(int enviadas, int inseridas, int atualizadas, int removidas) extends Record
Métricas de uma operação UPSERT diff-aware + DELETE seletivo no caminho idempotente (spec 004 — § 4.7).

Por construção, enviadas == inseridas + atualizadas + inalteradas: linhas no upload cuja chave já existia e o conteúdo bate são filtradas pelo WHERE IS DISTINCT FROM e nem aparecem no RETURNING, virando inalteradas() (zero evento de WAL).

  • Constructor Summary

    Constructors
    Constructor
    Description
    UpsertResultado(int enviadas, int inseridas, int atualizadas, int removidas)
    Creates an instance of a UpsertResultado record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the atualizadas record component.
    int
    Returns the value of the enviadas record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Linhas no upload que não geraram WAL (chave colidiu e conteúdo era idêntico).
    int
    Returns the value of the inseridas record component.
    int
    Returns the value of the removidas record component.
    final String
    Returns a string representation of this record class.
    int
    Soma de todas as linhas que produziram evento de WAL (e portanto checkpoint PowerSync).

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UpsertResultado

      public UpsertResultado(int enviadas, int inseridas, int atualizadas, int removidas)
      Creates an instance of a UpsertResultado record class.
      Parameters:
      enviadas - the value for the enviadas record component
      inseridas - the value for the inseridas record component
      atualizadas - the value for the atualizadas record component
      removidas - the value for the removidas record component
  • Method Details

    • inalteradas

      public int inalteradas()
      Linhas no upload que não geraram WAL (chave colidiu e conteúdo era idêntico).
      Returns:
      quantidade de linhas inalteradas (enviadas - inseridas - atualizadas).
    • totalAlteracoes

      public int totalAlteracoes()
      Soma de todas as linhas que produziram evento de WAL (e portanto checkpoint PowerSync).
      Returns:
      total de alterações (inseridas + atualizadas + removidas).
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • enviadas

      public int enviadas()
      Returns the value of the enviadas record component.
      Returns:
      the value of the enviadas record component
    • inseridas

      public int inseridas()
      Returns the value of the inseridas record component.
      Returns:
      the value of the inseridas record component
    • atualizadas

      public int atualizadas()
      Returns the value of the atualizadas record component.
      Returns:
      the value of the atualizadas record component
    • removidas

      public int removidas()
      Returns the value of the removidas record component.
      Returns:
      the value of the removidas record component