Package lu.kbra.pclib.db.table
Class DBTableProxy<V extends DatabaseTable<T>,T extends DatabaseEntry>
java.lang.Object
lu.kbra.pclib.db.table.DBTableProxy<V,T>
- All Implemented Interfaces:
SQLQueryable<T>,AbstractDBTable<T>
public class DBTableProxy<V extends DatabaseTable<T>,T extends DatabaseEntry>
extends Object
implements AbstractDBTable<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintclear()intcount()intcountNotNull(T data) intcountUniques(T data) booleancreate()Deprecated.<C extends Collection<T>>
CdeleteAll(C datas) <C extends Collection<T>,D extends Collection<T>>
DdeleteAllIfExists(C datas, Supplier<D> supplier) deleteIfExists(T data) deleteUnique(T data) deleteUniques(T data) drop()Deprecated.booleanexists()Deprecated.booleanbooleanexistsUnique(T data) booleanexistsUniques(T data) <C extends Collection<T>,D extends Collection<T>>
DfilterExists(C datas, Supplier<D> supplier) <C extends Collection<T>,D extends Collection<T>>
DfilterExistsByUnique(C datas, Supplier<D> supplier) <C extends Collection<T>,D extends Collection<T>>
DfilterExistsUnique(C datas, Supplier<D> supplier) String[]Deprecated.getStatementAsSQL(Statement stmt) <C extends Collection<T>>
CinsertAll(C data) insertAndReload(T data) <C extends Collection<T>>
CinsertAndReloadAll(C datas) <C extends Collection<T>>
CloadAll(C datas) <C extends Collection<T>,D extends Collection<T>>
DloadAllByUnique(C datas, Supplier<D> supplier) <C extends Collection<T>,D extends Collection<T>>
DloadAllIfExists(C datas, Supplier<D> supplier) <C extends Collection<T>>
CloadAllUnique(C datas) loadByUnique(T data) Returns a list of all the possible entries matching with the unique values of the input.loadIfExists(T data) loadIfExistsElseInsert(T data) Loads the first pk result, returns a the newly inserted instance if none is foundloadUnique(T data) Loads the only unique result, or throws an exception if none is found.loadUniqueIfExists(T data) Loads the only unique result, returns null if none is found and throws an exception if too many are available.Loads the first unique result, returns a the newly inserted instance if none is found and throws an exception if too many are available.Loads the first unique result, returns null if none is found and throws an exception if too many are available.<B> BvoidsetQueryableHookManager(SQLQueryableHookManager queryableHookManager) Deprecated.voidsetTableStructure(TableStructure tableStructure) Deprecated.inttruncate()Deprecated.<C extends Collection<T>>
CupdateAll(C datas) updateAndReload(T data) <C extends Collection<T>>
CupdateAndReloadAll(C datas) updateAndReloadIfExists(T data) updateIfExists(T data) updateIfExistsElseInsert(T data) protected final <R,T extends RuntimeException>
RuseWithTry(ThrowingFunction<AbstractConnection, R, T> supplier) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface lu.kbra.pclib.db.table.AbstractDBTable
getTableIdMethods inherited from interface lu.kbra.pclib.db.impl.SQLQueryable
getEntryClass, getName, getQualifiedName, getTargetClass
-
Field Details
-
delegate
-
useMethod
-
-
Constructor Details
-
DBTableProxy
-
-
Method Details
-
clear
- Specified by:
clearin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
count
- Specified by:
countin interfaceSQLQueryable<V extends DatabaseTable<T>>- Throws:
DBException
-
countNotNull
- Specified by:
countNotNullin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
countUniques
- Specified by:
countUniquesin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
create
Deprecated.- Specified by:
createin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Specified by:
createin interfaceSQLQueryable<V extends DatabaseTable<T>>- Returns:
- true if it was created
- Throws:
DBException
-
delete
- Specified by:
deletein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
deleteAll
- Specified by:
deleteAllin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
deleteAllIfExists
public <C extends Collection<T>,D extends Collection<T>> D deleteAllIfExists(C datas, Supplier<D> supplier) throws DBException - Specified by:
deleteAllIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
deleteIfExists
- Specified by:
deleteIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
deleteUnique
- Specified by:
deleteUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
deleteUniques
- Specified by:
deleteUniquesin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
drop
Deprecated.- Specified by:
dropin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
exists
Deprecated.- Specified by:
existsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Specified by:
existsin interfaceSQLQueryable<V extends DatabaseTable<T>>- Throws:
DBException
-
exists
- Specified by:
existsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
existsUnique
- Specified by:
existsUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
existsUniques
- Specified by:
existsUniquesin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
filterExists
public <C extends Collection<T>,D extends Collection<T>> D filterExists(C datas, Supplier<D> supplier) throws DBException - Specified by:
filterExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
filterExistsUnique
public <C extends Collection<T>,D extends Collection<T>> D filterExistsUnique(C datas, Supplier<D> supplier) throws DBException - Specified by:
filterExistsUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
TooManyMatchingRowsException- if a row matches> 0unique rowsDBException
-
getConnector
- Specified by:
getConnectorin interfaceSQLQueryable<V extends DatabaseTable<T>>
-
getCreateSQL
Deprecated.- Specified by:
getCreateSQLin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
getCustomHints
- Specified by:
getCustomHintsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Specified by:
getCustomHintsin interfaceSQLQueryable<V extends DatabaseTable<T>>
-
getDatabase
- Specified by:
getDatabasein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Specified by:
getDatabasein interfaceSQLQueryable<V extends DatabaseTable<T>>
-
getDatabaseEntryUtils
- Specified by:
getDatabaseEntryUtilsin interfaceSQLQueryable<V extends DatabaseTable<T>>
-
getQueryableHookManager
- Specified by:
getQueryableHookManagerin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Specified by:
getQueryableHookManagerin interfaceSQLQueryable<V extends DatabaseTable<T>>
-
getStatementAsSQL
- Specified by:
getStatementAsSQLin interfaceSQLQueryable<V extends DatabaseTable<T>>
-
getStructure
- Specified by:
getStructurein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Specified by:
getStructurein interfaceSQLQueryable<V extends DatabaseTable<T>>
-
insert
- Specified by:
insertin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
insertAll
- Specified by:
insertAllin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
insertAndReload
- Specified by:
insertAndReloadin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
insertAndReloadAll
- Specified by:
insertAndReloadAllin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
load
- Specified by:
loadin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadAll
- Specified by:
loadAllin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadByUnique
Description copied from interface:AbstractDBTableReturns a list of all the possible entries matching with the unique values of the input.- Specified by:
loadByUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadAllIfExists
public <C extends Collection<T>,D extends Collection<T>> D loadAllIfExists(C datas, Supplier<D> supplier) throws DBException - Specified by:
loadAllIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadIfExists
- Specified by:
loadIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadIfExistsElseInsert
Description copied from interface:AbstractDBTableLoads the first pk result, returns a the newly inserted instance if none is found- Specified by:
loadIfExistsElseInsertin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadUnique
Description copied from interface:AbstractDBTableLoads the only unique result, or throws an exception if none is found.- Specified by:
loadUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadUniqueIfExists
Description copied from interface:AbstractDBTableLoads the only unique result, returns null if none is found and throws an exception if too many are available.- Specified by:
loadUniqueIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadUniqueIfExistsElseInsert
Description copied from interface:AbstractDBTableLoads the first unique result, returns a the newly inserted instance if none is found and throws an exception if too many are available.- Specified by:
loadUniqueIfExistsElseInsertin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
query
- Specified by:
queryin interfaceSQLQueryable<V extends DatabaseTable<T>>- Throws:
DBException
-
setQueryableHookManager
Deprecated.- Specified by:
setQueryableHookManagerin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
setTableStructure
Deprecated.- Specified by:
setTableStructurein interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
truncate
Deprecated.- Specified by:
truncatein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
update
- Specified by:
updatein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
updateAll
- Specified by:
updateAllin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
updateAndReload
- Specified by:
updateAndReloadin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
updateAndReloadAll
- Specified by:
updateAndReloadAllin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
useWithTry
protected final <R,T extends RuntimeException> R useWithTry(ThrowingFunction<AbstractConnection, R, throws TT> supplier) - Throws:
T extends RuntimeException
-
updateAndReloadIfExists
- Specified by:
updateAndReloadIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
updateAndReloadIfExistsElseInsert
- Specified by:
updateAndReloadIfExistsElseInsertin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
updateAndReloadIfExistsElseInsertAndReload
- Specified by:
updateAndReloadIfExistsElseInsertAndReloadin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
updateIfExists
- Specified by:
updateIfExistsin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
updateIfExistsElseInsert
- Specified by:
updateIfExistsElseInsertin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
updateIfExistsElseInsertAndReload
- Specified by:
updateIfExistsElseInsertAndReloadin interfaceAbstractDBTable<V extends DatabaseTable<T>>
-
loadUniqueIfExistsElseInsertAndReload
Description copied from interface:AbstractDBTableLoads the first unique result, returns null if none is found and throws an exception if too many are available.- Specified by:
loadUniqueIfExistsElseInsertAndReloadin interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadAllUnique
- Specified by:
loadAllUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
loadAllByUnique
public <C extends Collection<T>,D extends Collection<T>> D loadAllByUnique(C datas, Supplier<D> supplier) throws DBException - Specified by:
loadAllByUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-
filterExistsByUnique
public <C extends Collection<T>,D extends Collection<T>> D filterExistsByUnique(C datas, Supplier<D> supplier) throws DBException - Specified by:
filterExistsByUniquein interfaceAbstractDBTable<V extends DatabaseTable<T>>- Throws:
DBException
-