Interface Table<K extends Comparable<? super K>,R extends Row<K,?>>

All Superinterfaces:
Collection<R>, Iterable<R>

public interface Table<K extends Comparable<? super K>,R extends Row<K,?>> extends Collection<R>
One table in the database.
  • Method Details

    • getModel

      Model getModel()
      Gets the model this table is part of.
    • clearCaches

      default void clearCaches()
      Clears the caches for this table that apply to the current thread. This is used to end a caching session, generally short-term and associated with a single request or process.

      Any overriding method should call super.clearCaches().

    • tableUpdated

      default void tableUpdated()
      Called after the table is updated to ensure cache integrity. Cache coherency is maintained between users for global tables. For per-user caches only your own view is affected; no updates will be seen until the end of their caching transaction, generally a web request.

      Any overriding method should call super.tableUpdated().

    • clear

      default void clear()
      Specified by:
      clear in interface Collection<K extends Comparable<? super K>>
    • retainAll

      default boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<K extends Comparable<? super K>>
    • removeAll

      default boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<K extends Comparable<? super K>>
    • addAll

      default boolean addAll(Collection<? extends R> c)
      Specified by:
      addAll in interface Collection<K extends Comparable<? super K>>
    • containsAll

      default boolean containsAll(Collection<?> c)
      Specified by:
      containsAll in interface Collection<K extends Comparable<? super K>>
    • remove

      default boolean remove(Object o)
      Specified by:
      remove in interface Collection<K extends Comparable<? super K>>
    • add

      default boolean add(R e)
      Specified by:
      add in interface Collection<K extends Comparable<? super K>>
    • toArray

      default <T> T[] toArray(T[] a)
      Specified by:
      toArray in interface Collection<K extends Comparable<? super K>>
    • toArray

      default Object[] toArray()
      Specified by:
      toArray in interface Collection<K extends Comparable<? super K>>
    • contains

      default boolean contains(Object o)
      Specified by:
      contains in interface Collection<K extends Comparable<? super K>>
    • isEmpty

      default boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<K extends Comparable<? super K>>
    • getSize

      default int getSize() throws SQLException
      Gets the number of accessible rows in this table. This also provides JavaBeans-compatible size.
      Throws:
      SQLException
    • size

      default int size()
      Specified by:
      size in interface Collection<K extends Comparable<? super K>>
    • getIterator

      default Iterator<? extends R> getIterator() throws SQLException
      Iterates the rows in sorted order. This also provides JavaBeans-compatible iterator.
      Throws:
      SQLException
      See Also:
    • iterator

      default Iterator<R> iterator()
      Iterates the rows in sorted order.
      Specified by:
      iterator in interface Collection<K extends Comparable<? super K>>
      Specified by:
      iterator in interface Iterable<K extends Comparable<? super K>>
      See Also:
    • getMap

      Map<K,? extends R> getMap()
      Gets a map view of this table.
    • getSortedMap

      SortedMap<K,? extends R> getSortedMap()
      Gets a sorted map view of this table.
    • getName

      default String getName()
      Gets the table name.
    • getUnsortedRows

      Set<? extends R> getUnsortedRows() throws SQLException
      Gets all rows in no particular order.

      This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.

      Throws:
      SQLException
    • getRows

      SortedSet<? extends R> getRows() throws SQLException
      Gets all rows, sorted by their natural ordering.

      This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.

      Throws:
      SQLException
    • canonicalize

      default K canonicalize(K key)
      Gets the canonical key used for internal indexing. In the case of case- insensitive matching, the key may have upper-case and lower-case matches, while the canonicalKey will convert to one format for matching. Any matches are performed on the canonical form the the query.
    • get

      R get(K key) throws NoRowException, SQLException
      Gets the row with the provided key.
      Throws:
      NoRowException - if not found
      SQLException - if database error occurs
    • getOrderedRows

      default Set<? extends R> getOrderedRows(Iterable<? extends K> keys) throws NoRowException, SQLException
      Gets an unmodifiable set of each object corresponding to the set of keys. The elements will be in the set in the same order as the keys iterator. If a key is found twice, the element we be in the position of the first key.

      This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.

      Throws:
      NoRowException - if any key is not found
      SQLException - if database error occurs
    • getRows

      default SortedSet<? extends R> getRows(Iterable<? extends K> keys) throws NoRowException, SQLException
      Gets an unmodifiable sorted set of each object corresponding to the set of keys, sorted by their natural ordering.

      This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.

      Throws:
      NoRowException - if any key is not found
      SQLException - if database error occurs