Record Class BulkLoadHandle

java.lang.Object
java.lang.Record
io.bloviate.ext.BulkLoadHandle
Record Components:
description - a short human-readable description of what was disabled, for logging

public record BulkLoadHandle(String description) extends Record
An opaque token returned by DatabaseSupport.disableConstraints(Connection, Database) describing what was disabled, so DatabaseSupport.enableConstraints(Connection, Database, BulkLoadHandle) can restore it.

The session-based PostgreSQL (session_replication_role) and MySQL (FOREIGN_KEY_CHECKS) mechanisms restore state with a fixed SET statement and carry no per-table state, so the handle is purely informational (a short description used for logging). It exists so a future catalog-level mechanism (e.g. dropping and recreating constraints) can carry the list of objects it must restore without changing the SPI signatures.

Since:
2.17.0
See Also:
  • Constructor Details

    • BulkLoadHandle

      public BulkLoadHandle(String description)
      Creates an instance of a BulkLoadHandle record class.
      Parameters:
      description - the value for the description record component
  • Method Details

    • of

      public static BulkLoadHandle of(String description)
      Creates a handle with the given description.
      Parameters:
      description - a short human-readable description of what was disabled
      Returns:
      the handle
    • 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.
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component