nxt.db

## Class EntityDbTable<T>

- java.lang.Object
- - nxt.db.DerivedDbTable
  - - nxt.db.TrimmableDbTable<T>
    - - nxt.db.EntityDbTable<T>

- Direct Known Subclasses:
    PersistentDbTable, VersionedEntityDbTable

      public abstract class EntityDbTable<T>
      extends TrimmableDbTable<T>

- - ### Field Summary

    - ### Fields inherited from class nxt.db.TrimmableDbTable

      `dbKeyFactory`

    - ### Fields inherited from class nxt.db.DerivedDbTable

      `db, table`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `EntityDbTable(java.lang.String table, DbKey.Factory<T> dbKeyFactory)`
    `protected` | `EntityDbTable(java.lang.String table, DbKey.Factory<T> dbKeyFactory, java.lang.String fullTextSearchColumns)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkAvailable(int height)`
    `protected void` | `clearCache()`
    `void` | `createSearchIndex(java.sql.Connection con)`
    `protected java.lang.String` | `defaultSort()`
    `T` | `get(DbKey dbKey)`
    `T` | `get(DbKey dbKey, boolean cache)`
    `T` | `get(DbKey dbKey, int height)`
    `DbIterator<T>` | `getAll(int from, int to)`
    `DbIterator<T>` | `getAll(int height, int from, int to)`
    `DbIterator<T>` | `getAll(int height, int from, int to, java.lang.String sort)`
    `DbIterator<T>` | `getAll(int from, int to, java.lang.String sort)`
    `T` | `getBy(DbClause dbClause)`
    `T` | `getBy(DbClause dbClause, int height)`
    `int` | `getCount()`
    `int` | `getCount(DbClause dbClause)`
    `int` | `getCount(DbClause dbClause, int height)`
    `DbIterator<T>` | `getManyBy(java.sql.Connection con, java.sql.PreparedStatement pstmt, boolean cache)`
    `DbIterator<T>` | `getManyBy(DbClause dbClause, int from, int to)`
    `DbIterator<T>` | `getManyBy(DbClause dbClause, int height, int from, int to)`
    `DbIterator<T>` | `getManyBy(DbClause dbClause, int height, int from, int to, java.lang.String sort)`
    `DbIterator<T>` | `getManyBy(DbClause dbClause, int from, int to, java.lang.String sort)`
    `int` | `getRowCount()`
    `void` | `insert(T t)`
    `protected abstract T` | `load(java.sql.Connection con, java.sql.ResultSet rs, DbKey dbKey)`
    `T` | `newEntity(DbKey dbKey)`
    `protected abstract void` | `save(java.sql.Connection con, T t)`
    `DbIterator<T>` | `search(java.lang.String query, DbClause dbClause, int from, int to)`
    `DbIterator<T>` | `search(java.lang.String query, DbClause dbClause, int from, int to, java.lang.String sort)`

    - ### Methods inherited from class nxt.db.TrimmableDbTable

      `canBeTrimmed, popOffTo, trim`

    - ### Methods inherited from class nxt.db.DerivedDbTable

      `isPersistent, rollback, toString, truncate`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EntityDbTable

          protected EntityDbTable(java.lang.String table,
                                  DbKey.Factory<T> dbKeyFactory)

    - #### EntityDbTable

          protected EntityDbTable(java.lang.String table,
                                  DbKey.Factory<T> dbKeyFactory,
                                  java.lang.String fullTextSearchColumns)

  - ### Method Detail

    - #### load

          protected abstract T load(java.sql.Connection con,
                                    java.sql.ResultSet rs,
                                    DbKey dbKey)
                             throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### save

          protected abstract void save(java.sql.Connection con,
                                       T t)
                                throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### defaultSort

          protected java.lang.String defaultSort()

    - #### clearCache

          protected void clearCache()

    - #### checkAvailable

          public void checkAvailable(int height)

    - #### newEntity

          public final T newEntity(DbKey dbKey)

    - #### get

          public final T get(DbKey dbKey)

    - #### get

          public final T get(DbKey dbKey,
                             boolean cache)

    - #### get

          public final T get(DbKey dbKey,
                             int height)

    - #### getBy

          public final T getBy(DbClause dbClause)

    - #### getBy

          public final T getBy(DbClause dbClause,
                               int height)

    - #### getManyBy

          public final DbIterator<T> getManyBy(DbClause dbClause,
                                               int from,
                                               int to)

    - #### getManyBy

          public final DbIterator<T> getManyBy(DbClause dbClause,
                                               int from,
                                               int to,
                                               java.lang.String sort)

    - #### getManyBy

          public final DbIterator<T> getManyBy(DbClause dbClause,
                                               int height,
                                               int from,
                                               int to)

    - #### getManyBy

          public final DbIterator<T> getManyBy(DbClause dbClause,
                                               int height,
                                               int from,
                                               int to,
                                               java.lang.String sort)

    - #### getManyBy

          public final DbIterator<T> getManyBy(java.sql.Connection con,
                                               java.sql.PreparedStatement pstmt,
                                               boolean cache)

    - #### search

          public final DbIterator<T> search(java.lang.String query,
                                            DbClause dbClause,
                                            int from,
                                            int to)

    - #### search

          public final DbIterator<T> search(java.lang.String query,
                                            DbClause dbClause,
                                            int from,
                                            int to,
                                            java.lang.String sort)

    - #### getAll

          public final DbIterator<T> getAll(int from,
                                            int to)

    - #### getAll

          public final DbIterator<T> getAll(int from,
                                            int to,
                                            java.lang.String sort)

    - #### getAll

          public final DbIterator<T> getAll(int height,
                                            int from,
                                            int to)

    - #### getAll

          public final DbIterator<T> getAll(int height,
                                            int from,
                                            int to,
                                            java.lang.String sort)

    - #### getCount

          public final int getCount()

    - #### getCount

          public final int getCount(DbClause dbClause)

    - #### getCount

          public final int getCount(DbClause dbClause,
                                    int height)

    - #### getRowCount

          public final int getRowCount()

    - #### insert

          public final void insert(T t)

    - #### createSearchIndex

          public final void createSearchIndex(java.sql.Connection con)
                                       throws java.sql.SQLException

      Overrides:
        `createSearchIndex` in class `DerivedDbTable`
      Throws:
        `java.sql.SQLException`