Package nxt.db
Class EntityDbTable<T>
- java.lang.Object
-
- nxt.db.DerivedDbTable
-
- nxt.db.EntityDbTable<T>
-
- Direct Known Subclasses:
PersistentDbTable
,VersionedEntityDbTable
public abstract class EntityDbTable<T> extends DerivedDbTable
-
-
Field Summary
Fields Modifier and Type Field Description protected DbKey.Factory<T>
dbKeyFactory
-
Fields inherited from class nxt.db.DerivedDbTable
db, table
-
-
Constructor Summary
Constructors Modifier Constructor 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 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()
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)
DbIterator<T>
getManyBy(DbClause dbClause1, DbClause dbClause2, int from, int to)
DbIterator<T>
getManyBy(DbClause dbClause1, DbClause dbClause2, 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)
void
rollback(int height)
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)
void
trim(int height)
-
Methods inherited from class nxt.db.DerivedDbTable
isPersistent, toString, truncate
-
-
-
-
Field Detail
-
dbKeyFactory
protected final DbKey.Factory<T> dbKeyFactory
-
-
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)
-
getManyBy
public final DbIterator<T> getManyBy(DbClause dbClause, int from, int to)
-
getManyBy
public final DbIterator<T> getManyBy(DbClause dbClause1, DbClause dbClause2, 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 dbClause1, DbClause dbClause2, 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()
-
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)
-
rollback
public void rollback(int height)
- Overrides:
rollback
in classDerivedDbTable
-
trim
public void trim(int height)
- Overrides:
trim
in classDerivedDbTable
-
createSearchIndex
public final void createSearchIndex(java.sql.Connection con) throws java.sql.SQLException
- Overrides:
createSearchIndex
in classDerivedDbTable
- Throws:
java.sql.SQLException
-
-