| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
TableManager.Action<B> |
static interface |
TableManager.DoEach<B>
interface for iterate
|
| 限定符和类型 | 方法和说明 |
|---|---|
B |
addIfAbsent(B bean)
If the specified key is not already exist, add it to database.
|
B |
checkDuplicate(B bean)
Check duplicated row by primary keys,if row exists throw exception
|
int |
countAll()
Retrieves the number of rows of the table.
|
int |
countUsingTemplate(B bean)
count the number of elements of a specific bean
|
int |
countUsingTemplate(B bean,
int searchType)
count the number of elements of a specific bean given the search type
|
int |
countWhere(java.lang.String where)
Retrieves the number of rows of the table with a 'where' clause.
|
B |
createBean()
Creates a new B instance.
|
int |
delete(B... beans)
Delete beans.
|
int |
delete(B bean)
Delete row according to primary keys of bean.
|
int |
delete(java.util.Collection<B> beans)
Delete beans.
|
int |
deleteAll()
Deletes all rows from table.
|
int |
deleteByPrimaryKey(java.lang.Object... keys)
Delete row according to its primary keys.
|
int |
deleteByWhere(java.lang.String where)
Deletes rows from the table using a 'where' clause.
|
int |
deleteUsingTemplate(B bean)
Deletes rows using a template.
|
boolean |
existsByPrimaryKey(B bean)
Returns true if this table contains row specified by primary key fields of B.
|
boolean |
existsPrimaryKey(java.lang.Object... keys)
Returns true if this table contains row with primary key fields.
|
<C extends java.lang.Iterable<B>> |
fastInsert(int[] fieldList,
C beans)
Insert the B bean list into the database.
|
void |
foreach(TableManager.DoEach<B> each,
boolean stopOnError)
Retrieves each row of B bean given a SQL where clause and a list of fields,
and dealt with each action.
|
void |
foreachByJoinWhere(TableManager.DoEach<B> each,
boolean stopOnError,
java.lang.String join,
java.lang.String where)
Retrieves each row of B bean given a SQL where clause and a list of fields,
and dealt with each action.
|
void |
foreachByWhere(TableManager.DoEach<B> each,
boolean stopOnError,
java.lang.String where)
Retrieves each row of B bean given a SQL where clause and a list of fields,
and dealt with each action.
|
IDataSourceConfig |
getDataSourceConfig() |
GeometryDataCodec |
getGeometryDataCodec() |
ListenerContainer<B> |
getListenerContainer() |
B[] |
loadAll()
Loads all the rows from table.
|
B[] |
loadAll(int startRow,
int numRows)
Loads the given number of rows from table, given the start row.
|
int |
loadAll(int startRow,
int numRows,
TableManager.Action<B> action)
Loads the given number of rows from table, given the start row and dealt with action.
|
int |
loadAll(TableManager.Action<B> action)
Loads each row from table and dealt with action.
|
java.util.List<B> |
loadAllAsList()
Loads all the rows from table.
|
java.util.List<B> |
loadAllAsList(int startRow,
int numRows)
Loads the given number of rows from table, given the start row.
|
java.util.List<B> |
loadByJoinWhereAsList(java.lang.String join,
java.lang.String where)
Retrieves a list of B bean given a sql 'where' clause.
|
java.util.List<B> |
loadByJoinWhereAsList(java.lang.String join,
java.lang.String where,
int[] fieldList,
int startRow,
int numRows)
Retrieves a list of B bean given a sql where clause and a list of fields, and startRow and numRows.
|
java.util.List<B> |
loadByJoinWhereAsList(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
int[] fieldList)
Retrieves a list of B bean given a sql where clause, and a list of fields.
|
<T> java.util.List<T> |
loadByJoinWhereAsList(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int startRow,
int numRows,
com.google.common.base.Function<B,T> transformer)
Retrieves a list of T bean given a sql where clause and a list of fields, and startRow and numRows.
|
int |
loadByJoinWhereForAction(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int startRow,
int numRows,
TableManager.Action<B> action)
Retrieves each row of B bean given a sql where clause and a list of fields, and startRow and numRows,
and dealt with action.
|
B |
loadByPrimaryKey(B bean)
Loads a B bean from the table using primary key fields of
bean. |
B |
loadByPrimaryKey(java.lang.Object... keys)
Loads a B bean from the table using primary key fields.
|
B |
loadByPrimaryKeyChecked(B bean)
see also
loadByPrimaryKey(BaseBean) |
B |
loadByPrimaryKeyChecked(java.lang.Object... keys)
see also
loadByPrimaryKey(Object...) |
B[] |
loadByWhere(java.lang.String where)
Retrieves an array of B given a sql 'where' clause.
|
B[] |
loadByWhere(java.lang.String where,
int[] fieldList)
Retrieves an array of B bean given a sql where clause, and a list of fields.
|
B[] |
loadByWhere(java.lang.String where,
int[] fieldList,
int startRow,
int numRows)
Retrieves an array of B bean given a sql where clause and a list of fields, and startRow and numRows.
|
int |
loadByWhere(java.lang.String where,
int[] fieldList,
int startRow,
int numRows,
TableManager.Action<B> action)
Retrieves each row of B bean given a sql where clause and a list of fields, and startRow and numRows,
and dealt with action.
|
int |
loadByWhere(java.lang.String where,
int[] fieldList,
TableManager.Action<B> action)
Retrieves each row of B bean given a sql where clause, and a list of fields,
and dealt with action.
|
int |
loadByWhere(java.lang.String where,
TableManager.Action<B> action)
Retrieves each row of B bean given a sql 'where' clause and dealt with action.
|
java.util.List<B> |
loadByWhereAsList(java.lang.String where)
Retrieves a list of B bean given a sql 'where' clause.
|
java.util.List<B> |
loadByWhereAsList(java.lang.String where,
int[] fieldList)
Retrieves a list of B bean given a sql where clause, and a list of fields.
|
java.util.List<B> |
loadByWhereAsList(java.lang.String where,
int[] fieldList,
int startRow,
int numRows)
Retrieves a list of B bean given a sql where clause and a list of fields, and startRow and numRows.
|
int |
loadByWhereForAction(java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int startRow,
int numRows,
TableManager.Action<B> action)
Retrieves each row of B bean given a sql where clause and a list of fields, and startRow and numRows,
and dealt wity action
It is up to you to pass the 'WHERE' in your where clauses.
|
<T> java.util.List<T> |
loadColumnAsList(java.lang.String column,
boolean distinct,
java.lang.String where,
int startRow,
int numRows)
Load column from table.
|
B |
loadUniqueUsingTemplate(B bean)
Loads a unique B bean from a template one giving a c
|
B |
loadUniqueUsingTemplateChecked(B bean)
Loads a unique B bean from a template one giving a c
|
B[] |
loadUsingTemplate(B bean)
Loads an array of B from a template one.
|
int |
loadUsingTemplate(B bean,
int[] fieldList,
int startRow,
int numRows,
int searchType,
TableManager.Action<B> action)
Loads each row from a template one, given the start row and number of rows and dealt with action.
|
B[] |
loadUsingTemplate(B bean,
int startRow,
int numRows)
Loads an array of B bean from a template one, given the start row and number of rows.
|
B[] |
loadUsingTemplate(B bean,
int startRow,
int numRows,
int searchType)
Loads a list of B bean from a template one, given the start row and number of rows.
|
int |
loadUsingTemplate(B bean,
int startRow,
int numRows,
TableManager.Action<B> action)
Loads each row from a template one, given the start row and number of rows and dealt with action.
|
int |
loadUsingTemplate(B bean,
TableManager.Action<B> action)
Loads each row from a template one and dealt with action.
|
java.util.List<B> |
loadUsingTemplateAsList(B bean)
Loads a list of B bean from a template one.
|
java.util.List<B> |
loadUsingTemplateAsList(B bean,
int startRow,
int numRows)
Loads a list of B bean from a template one, given the start row and number of rows.
|
java.util.List<B> |
loadUsingTemplateAsList(B bean,
int startRow,
int numRows,
int searchType)
Loads an array of B bean from a template one, given the start row and number of rows.
|
boolean |
lockAndUpdate(B bean)
锁定并更新指定的
bean。 |
java.util.List<B> |
lockAndUpdate(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int lockLimit,
java.lang.String extraLimitExp,
java.lang.Object[] extraLimitExpArgList,
LockUpateRunner<B> updateRunner)
锁定符合条件的行并根据锁定的行执行指定的更新操作。
|
java.util.List<B> |
lockAndUpdate(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
java.lang.String extraLimitExp,
java.lang.Object[] extraLimitExpArgList,
LockUpateRunner<B> updateRunner)
锁定符合条件的行并根据锁定的行执行指定的更新操作。
|
void |
registerListener(TableListener<B> listener)
Registers a unique
TableListener listener. |
int |
rowCountWhere(java.lang.String where,
java.lang.Object... argList)
Retrieves the number of rows of the table with a 'where' clause.
|
B |
save(B bean)
Saves the B bean into the database.
|
B[] |
save(B[] beans)
Saves an array of B bean into the database.
|
<C extends java.util.Collection<B>> |
save(C beans)
Saves a collection of B bean into the database as transaction.
|
B[] |
saveAsTransaction(B[] beans)
Saves an array of B bean into the database as transaction.
|
<C extends java.util.Collection<B>> |
saveAsTransaction(C beans)
Saves a collection of B bean into the database.
|
boolean |
setValueIfNonEqual(B bean,
java.lang.String column,
java.lang.Object value)
set a value to the given field in bean if value is not equal to the given field of old record in database
|
boolean |
setValueIfNonNull(B bean,
java.lang.String column,
java.lang.Object value)
set a value to the given field in bean if the given field of old record in database is not null
|
void |
unregisterListener(TableListener<B> listener)
remove listener.
|
int |
updateWithCondition(B bean,
java.lang.String extraUpdateExp,
java.lang.Object[] extraUpdateExpArgList)
根据指定条件更新数据库中 B 类型的 bean 记录。
|
rowCountOf, runAsTransaction, runAsTransaction, runSql, runSql, runSqlAsList, runSqlAsList, runSqlAsList, runSqlForMap, runSqlForValue, runWithNoPage, runWithNoPageB createBean()
int countAll()
throws RuntimeDaoException
RuntimeDaoExceptionint countUsingTemplate(B bean) throws RuntimeDaoException
bean - the bean to look for ant countRuntimeDaoExceptionint countUsingTemplate(B bean, int searchType) throws RuntimeDaoException
bean - the template to look forsearchType - exact ? like ? starting like ? ending link ? Constant.SEARCH_EXACT Constant.SEARCH_LIKE Constant.SEARCH_STARTING_LIKE Constant.SEARCH_ENDING_LIKE RuntimeDaoExceptionint countWhere(java.lang.String where)
throws RuntimeDaoException
where - the restriction clauseRuntimeDaoExceptionint rowCountWhere(java.lang.String where,
java.lang.Object... argList)
throws RuntimeDaoException
where - the restriction clauseargList - the arguments to use fill given prepared statement,may be nullRuntimeDaoExceptionint deleteAll()
throws RuntimeDaoException
RuntimeDaoExceptionint deleteByWhere(java.lang.String where)
throws RuntimeDaoException
where - the sql 'where' clauseRuntimeDaoExceptionint deleteUsingTemplate(B bean) throws RuntimeDaoException
bean - the template object(s) to be deletedRuntimeDaoExceptionint deleteByPrimaryKey(java.lang.Object... keys)
throws RuntimeDaoException
keys - primary keys valueRuntimeDaoExceptionint delete(B bean) throws RuntimeDaoException
bean - will be deleted ,all keys must not be nullRuntimeDaoExceptionint delete(B... beans) throws RuntimeDaoException
beans - B array will be deletedRuntimeDaoExceptionint delete(java.util.Collection<B> beans) throws RuntimeDaoException
beans - B collection will be deletedRuntimeDaoExceptionboolean setValueIfNonNull(B bean, java.lang.String column, java.lang.Object value)
bean - column - column namevalue - boolean setValueIfNonEqual(B bean, java.lang.String column, java.lang.Object value)
bean - column - column namevalue - B[] loadAll() throws RuntimeDaoException
RuntimeDaoExceptionint loadAll(TableManager.Action<B> action) throws RuntimeDaoException
action - Action object for do something(not null)RuntimeDaoExceptionB[] loadAll(int startRow, int numRows) throws RuntimeDaoException
startRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionint loadAll(int startRow,
int numRows,
TableManager.Action<B> action)
throws RuntimeDaoException
startRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)action - Action object for do something(not null)RuntimeDaoExceptionjava.util.List<B> loadAllAsList() throws RuntimeDaoException
RuntimeDaoExceptionjava.util.List<B> loadAllAsList(int startRow, int numRows) throws RuntimeDaoException
startRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionB loadByPrimaryKey(B bean) throws RuntimeDaoException
bean.bean - the B bean with primary key fieldsnull if not found or bean is nullRuntimeDaoExceptionB loadByPrimaryKeyChecked(B bean) throws RuntimeDaoException, ObjectRetrievalException
loadByPrimaryKey(BaseBean)bean - ObjectRetrievalException - not foundRuntimeDaoExceptionB loadByPrimaryKey(java.lang.Object... keys) throws RuntimeDaoException
keys - primary keys value:null if not foundRuntimeDaoExceptionB loadByPrimaryKeyChecked(java.lang.Object... keys) throws RuntimeDaoException, ObjectRetrievalException
loadByPrimaryKey(Object...)keys - ObjectRetrievalException - not foundRuntimeDaoExceptionboolean existsPrimaryKey(java.lang.Object... keys)
throws RuntimeDaoException
keys - primary keys valueRuntimeDaoExceptionloadByPrimaryKey(Object...)boolean existsByPrimaryKey(B bean) throws RuntimeDaoException
bean - the B bean with primary key fieldsRuntimeDaoExceptionloadByPrimaryKey(BaseBean)B checkDuplicate(B bean) throws RuntimeDaoException, ObjectRetrievalException
bean - the B bean with primary key fieldsObjectRetrievalException - has duplicated recordRuntimeDaoExceptionexistsByPrimaryKey(BaseBean)B[] loadByWhere(java.lang.String where) throws RuntimeDaoException
where - the sql 'where' clauseRuntimeDaoExceptionint loadByWhere(java.lang.String where,
TableManager.Action<B> action)
throws RuntimeDaoException
where - the sql 'where' clauseaction - Action object for do something(not null)RuntimeDaoExceptionB[] loadByWhere(java.lang.String where, int[] fieldList) throws RuntimeDaoException
where - the sql 'WHERE' clausefieldList - array of field's IDRuntimeDaoExceptionint loadByWhere(java.lang.String where,
int[] fieldList,
TableManager.Action<B> action)
throws RuntimeDaoException
where - the sql 'WHERE' clausefieldList - array of field's IDaction - Action object for do something(not null)RuntimeDaoExceptionB[] loadByWhere(java.lang.String where, int[] fieldList, int startRow, int numRows) throws RuntimeDaoException
where - the sql 'where' clausefieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionint loadByWhere(java.lang.String where,
int[] fieldList,
int startRow,
int numRows,
TableManager.Action<B> action)
throws RuntimeDaoException
where - the sql 'where' clausefieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)action - Action object for do something(not null)RuntimeDaoExceptionjava.util.List<B> loadByWhereAsList(java.lang.String where) throws RuntimeDaoException
where - the sql 'where' clauseRuntimeDaoExceptionjava.util.List<B> loadByJoinWhereAsList(java.lang.String join, java.lang.String where) throws RuntimeDaoException
join - the sql 'join' clausewhere - the sql 'where' clauseRuntimeDaoExceptionjava.util.List<B> loadByWhereAsList(java.lang.String where, int[] fieldList) throws RuntimeDaoException
where - the sql 'WHERE' clausefieldList - array of field's IDRuntimeDaoExceptionjava.util.List<B> loadByJoinWhereAsList(java.lang.String join, java.lang.String where, java.lang.Object[] argList, int[] fieldList) throws RuntimeDaoException
join - the sql 'join' clausewhere - the sql 'WHERE' clauseargList - the arguments to use fill given prepared statement,may be nullfieldList - array of field's IDRuntimeDaoExceptionjava.util.List<B> loadByWhereAsList(java.lang.String where, int[] fieldList, int startRow, int numRows) throws RuntimeDaoException
where - the sql 'where' clausefieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionjava.util.List<B> loadByJoinWhereAsList(java.lang.String join, java.lang.String where, int[] fieldList, int startRow, int numRows) throws RuntimeDaoException
join - the sql 'join' clausewhere - the sql 'where' clausefieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoException<T> java.util.List<T> loadByJoinWhereAsList(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int startRow,
int numRows,
com.google.common.base.Function<B,T> transformer)
throws RuntimeDaoException
join - the sql 'join' clausewhere - the sql 'where' clauseargList - the arguments to use fill given prepared statement,may be nullfieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)transformer - cast B to TRuntimeDaoExceptionint loadByWhereForAction(java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int startRow,
int numRows,
TableManager.Action<B> action)
throws RuntimeDaoException
where - the sql 'where' clauseargList - the arguments to use fill given prepared statement,may be nullfieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)action - Action object for do something(not null)RuntimeDaoExceptionint loadByJoinWhereForAction(java.lang.String join,
java.lang.String where,
java.lang.Object[] argList,
int[] fieldList,
int startRow,
int numRows,
TableManager.Action<B> action)
throws RuntimeDaoException
join - the sql 'join' clausewhere - the sql 'where' clauseargList - the arguments to use fill given prepared statement,may be nullfieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)action - Action object for do something(not null)RuntimeDaoExceptionB loadUniqueUsingTemplate(B bean) throws RuntimeDaoException
bean - the B bean to look fornull if not found or null input argumentObjectRetrievalException - more than one rowRuntimeDaoExceptionB loadUniqueUsingTemplateChecked(B bean) throws RuntimeDaoException, ObjectRetrievalException
bean - the B bean to look forObjectRetrievalException - not found or more than one rowRuntimeDaoExceptionB[] loadUsingTemplate(B bean) throws RuntimeDaoException
bean - the B bean template to look forRuntimeDaoExceptionint loadUsingTemplate(B bean, TableManager.Action<B> action) throws RuntimeDaoException
bean - the B bean template to look foraction - Action object for do something(not null)RuntimeDaoExceptionB[] loadUsingTemplate(B bean, int startRow, int numRows) throws RuntimeDaoException
bean - the B bean template to look forstartRow - the start row to be used (first row = 1, last row=-1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionint loadUsingTemplate(B bean, int startRow, int numRows, TableManager.Action<B> action) throws RuntimeDaoException
bean - the B bean template to look forstartRow - the start row to be used (first row = 1, last row=-1)numRows - the number of rows to be retrieved (all rows = a negative number)action - Action object for do something(not null)RuntimeDaoExceptionint loadUsingTemplate(B bean, int[] fieldList, int startRow, int numRows, int searchType, TableManager.Action<B> action) throws RuntimeDaoException
bean - the B template to look forfieldList - table of the field's associated constantsstartRow - the start row to be used (first row = 1, last row=-1)numRows - the number of rows to be retrieved (all rows = a negative number)searchType - exact ? like ? starting like ? ending link ? Constant.SEARCH_EXACT Constant.SEARCH_LIKE Constant.SEARCH_STARTING_LIKE Constant.SEARCH_ENDING_LIKE action - Action object for do something(not null)RuntimeDaoExceptionB[] loadUsingTemplate(B bean, int startRow, int numRows, int searchType) throws RuntimeDaoException
bean - the B bean template to look forstartRow - the start row to be used (first row = 1, last row=-1)numRows - the number of rows to be retrieved (all rows = a negative number)searchType - exact ? like ? starting like ? ending link ? Constant.SEARCH_EXACT Constant.SEARCH_LIKE Constant.SEARCH_STARTING_LIKE Constant.SEARCH_ENDING_LIKE RuntimeDaoExceptionjava.util.List<B> loadUsingTemplateAsList(B bean) throws RuntimeDaoException
bean - the B bean template to look forRuntimeDaoExceptionjava.util.List<B> loadUsingTemplateAsList(B bean, int startRow, int numRows) throws RuntimeDaoException
bean - the B bean template to look forstartRow - the start row to be used (first row = 1, last row=-1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionjava.util.List<B> loadUsingTemplateAsList(B bean, int startRow, int numRows, int searchType) throws RuntimeDaoException
bean - the B bean template to look forstartRow - the start row to be used (first row = 1, last row=-1)numRows - the number of rows to be retrieved (all rows = a negative number)searchType - exact ? like ? starting like ? ending link? Constant.SEARCH_EXACT Constant.SEARCH_LIKE Constant.SEARCH_STARTING_LIKE Constant.SEARCH_ENDING_LIKE RuntimeDaoExceptionvoid foreachByWhere(TableManager.DoEach<B> each, boolean stopOnError, java.lang.String where) throws RuntimeDaoException
each - DoForEach object for do something(not null)stopOnError - stop on errorwhere - the SQL 'where' clause, retrieves all rows if null or emptyRuntimeDaoExceptionvoid foreachByJoinWhere(TableManager.DoEach<B> each, boolean stopOnError, java.lang.String join, java.lang.String where) throws RuntimeDaoException
each - DoForEach object for do something(not null)stopOnError - stop on errorjoin - the sql 'join' clausewhere - the SQL 'where' clause, retrieves all rows if null or emptyRuntimeDaoExceptionvoid foreach(TableManager.DoEach<B> each, boolean stopOnError) throws RuntimeDaoException
each - DoForEach object for do something(not null)stopOnError - stop on errorRuntimeDaoExceptionvoid registerListener(TableListener<B> listener)
listener - void unregisterListener(TableListener<B> listener)
listener - B save(B bean) throws RuntimeDaoException
bean - the B bean to be savedRuntimeDaoExceptionB addIfAbsent(B bean) throws RuntimeDaoException
if (!existsByPrimaryKey(bean))
return insert(bean);
else
return loadByPrimaryKey(bean);
except that the action is performed atomically .bean - the B bean to be savednull if bean is nullRuntimeDaoExceptionB[] save(B[] beans) throws RuntimeDaoException
beans - the array of B bean to be savedRuntimeDaoException<C extends java.util.Collection<B>> C saveAsTransaction(C beans) throws RuntimeDaoException
beans - the B bean table to be savedRuntimeDaoExceptionB[] saveAsTransaction(B[] beans) throws RuntimeDaoException
beans - the B bean table to be savedRuntimeDaoExceptionsave(BaseBean[])<C extends java.util.Collection<B>> C save(C beans) throws RuntimeDaoException
beans - the B bean table to be savedRuntimeDaoException<C extends java.lang.Iterable<B>> void fastInsert(int[] fieldList, C beans)
TableListenerfieldList - table of the field's associated constants,if null as all fieldbeans - the B bean list to be savedRuntimeDaoException<T> java.util.List<T> loadColumnAsList(java.lang.String column,
boolean distinct,
java.lang.String where,
int startRow,
int numRows)
throws RuntimeDaoException
column - column name or java file name of Bdistinct - select distinct valueswhere - the sql 'where' clausestartRow - the start row to be used (first row = 1, last row = -1)numRows - the number of rows to be retrieved (all rows = a negative number)RuntimeDaoExceptionListenerContainer<B> getListenerContainer()
IDataSourceConfig getDataSourceConfig()
GeometryDataCodec getGeometryDataCodec()
java.util.List<B> lockAndUpdate(java.lang.String join, java.lang.String where, java.lang.Object[] argList, int[] fieldList, int lockLimit, java.lang.String extraLimitExp, java.lang.Object[] extraLimitExpArgList, LockUpateRunner<B> updateRunner) throws RuntimeDaoException
该方法会在事务中尝试锁定符合条件的行,若成功锁定则调用传入的更新操作对锁定的行进行更新。
如果没有锁定到任何行,返回空表。
NOTE:锁定成功传递给更新操作的行对象(updateRunner)的锁定行对象中仅包含的字段由fieldList决定。
join - 连接条件,用于表连接操作。为 null 时不添加连接条件。where - 筛选条件,用于过滤符合条件的行。为 null 时不添加筛选条件。argList - 参数列表,用于填充SQL语句中的占位符。为 null 则不填充。fieldList - 字段列表,指定要查询的字段。为 null 时查询所有字段。lockLimit - 锁定行数限制,若大于0,则锁定符合条件的前N行。为0时,锁定符合条件的所有行。extraLimitExp - 额外的筛选条件,用于过滤符合条件的行,可为{code null}。extraLimitExpArgList - 额外筛选条件参数列表,用于填充额外筛选条件中的占位符。为 null 则不填充。updateRunner - 行更新逻辑,用于根据锁定的行执行更新逻辑,不能为 null。RuntimeDaoException - 执行过程中出现运行时数据访问异常时抛出。java.util.List<B> lockAndUpdate(java.lang.String join, java.lang.String where, java.lang.Object[] argList, java.lang.String extraLimitExp, java.lang.Object[] extraLimitExpArgList, LockUpateRunner<B> updateRunner) throws RuntimeDaoException
该方法会在事务中尝试锁定符合条件的行,若成功锁定则调用传入的更新操作对锁定的行进行更新。
如果没有锁定到任何行,返回空表。
NOTE:锁定成功传递给更新操作的行对象(updateRunner)的锁定行对象中仅包含主键字段。
join - 连接条件,用于表连接操作。where - 筛选条件,用于过滤符合条件的行。argList - 参数列表,用于填充SQL语句中的占位符。为 null 则不填充。extraLimitExp - 额外的筛选条件,用于过滤符合条件的行,可为{code null}。extraLimitExpArgList - 额外筛选条件参数列表,用于填充额外筛选条件中的占位符。为 null 则不填充。updateRunner - 行更新逻辑,用于对锁定的行进行更新,不能为 null。RuntimeDaoException - 执行过程中出现运行时数据访问异常时抛出。boolean lockAndUpdate(B bean) throws RuntimeDaoException
bean。
该方法会先检查传入的bean:
如果为空或为新记录,返回false。如果bean的主键存在空值则抛出 RuntimeDaoException 异常。
接着会根据bean的主键生成 WHERE 条件,
调用 #lockAndUpdate(String, String, Object[], int[], int, String, Object[], java.util.function.Consumer) 方法进行锁定并更新操作。
若锁定过程中出现问题,返回false。
bean - 要锁定并更新的记录,类型为 B。RuntimeDaoException - 当传入的bean为空或主键存在空值时抛出。int updateWithCondition(B bean, java.lang.String extraUpdateExp, java.lang.Object[] extraUpdateExpArgList) throws RuntimeDaoException
该方法会根据传入的 bean 对象的修改信息生成更新语句,同时可以结合额外的更新条件进行更新操作。
如果 bean 为 null 或者没有被修改,则不会进行更新操作,直接返回 0。
如果 bean 是新创建的,也不会进行更新操作,直接返回 0。
如果表存在乐观锁字段,会在更新时进行乐观锁检查。
bean - 要更新的 B 类型的 bean 对象extraUpdateExp - 额外的更新条件表达式,可为 nullextraUpdateExpArgList - 额外更新条件表达式对应的参数列表,可为 nullRuntimeDaoException - 当发生数据库操作异常时抛出Copyright © 2025. All Rights Reserved.