Interface SchemaTemplate

  • All Superinterfaces:
    Metadata

    public interface SchemaTemplate
    extends Metadata
    A Relational schema template metadata.
    • Method Detail

      • getVersion

        int getVersion()
        Returns the version of the schema template.
        Returns:
        The version of the schema template.
      • isEnableLongRows

        boolean isEnableLongRows()
        Returns true if long rows are permitted in tables of this template, else false.
        Returns:
        true if long rows are permitted in tables of this template, else false.
      • isStoreRowVersions

        boolean isStoreRowVersions()
        Returns true if each row is stored along with an monotonically increasing version. This is required to make use of the row_version() function within queries and indexes.
        Returns:
        true if each row is stored along with a monotonically increasing row_version().
      • findTableByName

        @Nonnull
        java.util.Optional<Table> findTableByName​(@Nonnull
                                                  java.lang.String tableName)
                                           throws RelationalException
        Retrieves a Table by looking up its name.
        Parameters:
        tableName - The name of the Table.
        Returns:
        An Optional containing the Table if it is found, otherwise Empty.
        Throws:
        RelationalException
      • getIndexEntriesAsBitset

        @Nonnull
        java.util.BitSet getIndexEntriesAsBitset​(@Nonnull
                                                 java.util.Optional<java.util.Set<java.lang.String>> readableIndexNames)
                                          throws RelationalException
        Returns a BitSet whose bits are set for each of passed index names.
        Example for a given schema template st with indexes i1, i2, i3, i4 whose order are as-defined, calling st.getIndexEntriesAsBitset(Optiona.of(Set.of("i2", "i3")) returns a bitset of 0110.
        Parameters:
        readableIndexNames - The readable index names, providing an Optional.empty() returns a bitset with bits set to 1.
        Returns:
        a bit set whose bits are set for each of the passed readable index names.
        Throws:
        RelationalException - If a readable index is not found.
      • generateSchema

        @Nonnull
        Schema generateSchema​(@Nonnull
                              java.lang.String databaseId,
                              @Nonnull
                              java.lang.String schemaName)
        Creates a Schema instance using the specified.
        Parameters:
        databaseId - The ID of the database.
        schemaName - The name of the Schema.
        Returns:
        A new Schema instance with the specified name, database Id, version containing the same set of Tables in this SchemaTemplate.
      • accept

        default void accept​(@Nonnull
                            Visitor visitor)
        Specified by:
        accept in interface Metadata