Record Class JdbcTables

java.lang.Object
java.lang.Record
me.ahoo.cosid.store.jdbc.JdbcTables
Record Components:
range - the table of ranges, cosid_range by default
slot - the table of slots, cosid_slot by default
namespace - the table of namespace metadata, cosid_namespace by default

public record JdbcTables(String range, String slot, String namespace) extends Record
The table names of a JDBC store (06-stores.md ยง2.1): options.rangeTable, slotTable and namespaceTable. Each is an identifier, optionally schema-qualified (cosid.cosid_range); the store writes them into its SQL as they are, so anything else is rejected.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final JdbcTables
    The default names: cosid_range, cosid_slot, cosid_namespace.
  • Constructor Summary

    Constructors
    Constructor
    Description
    JdbcTables(String range, String slot, String namespace)
    Creates an instance of a JdbcTables record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    The name of the slot table's index on (namespace, last_owner_key): the unqualified slot table name with _last_owner_key, so that two stores with their own slot tables in one schema have their own indexes.
    Returns the value of the namespace record component.
    static JdbcTables
    of(Map<String,Object> options)
    The table names given by store options, the defaults for those not given.
    Returns the value of the range record component.
    Rewrites SQL written for the default names (such as a schema-*.sql resource) to these names.
    Returns the value of the slot record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • DEFAULT

      public static final JdbcTables DEFAULT
      The default names: cosid_range, cosid_slot, cosid_namespace.
  • Constructor Details

    • JdbcTables

      public JdbcTables(String range, String slot, String namespace)
      Creates an instance of a JdbcTables record class.
      Parameters:
      range - the value for the range record component
      slot - the value for the slot record component
      namespace - the value for the namespace record component
  • Method Details

    • of

      public static JdbcTables of(Map<String,Object> options)
      The table names given by store options, the defaults for those not given.
      Parameters:
      options - the store options: rangeTable, slotTable, namespaceTable
      Returns:
      the table names
    • lastOwnerIndex

      public String lastOwnerIndex()
      The name of the slot table's index on (namespace, last_owner_key): the unqualified slot table name with _last_owner_key, so that two stores with their own slot tables in one schema have their own indexes.
      Returns:
      the index name, cosid_slot_last_owner_key by default
    • rename

      public String rename(String sql)
      Rewrites SQL written for the default names (such as a schema-*.sql resource) to these names.
      Parameters:
      sql - the SQL naming cosid_range, cosid_slot and cosid_namespace
      Returns:
      the SQL naming these tables
    • 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.
    • range

      public String range()
      Returns the value of the range record component.
      Returns:
      the value of the range record component
    • slot

      public String slot()
      Returns the value of the slot record component.
      Returns:
      the value of the slot record component
    • namespace

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