程序包 gu.sql2java
接口 TableManager<B extends BaseBean>
- 所有超级接口:
SqlRunner
Interface to handle database calls (save, load, count, etc...) for table.
- 作者:
- guyadong
-
嵌套类概要
嵌套类修饰符和类型接口说明static interfacestatic interfaceinterface for iterate -
方法概要
修饰符和类型方法说明addIfAbsent(B bean) If the specified key is not already exist, add it to database.checkDuplicate(B bean) Check duplicated row by primary keys,if row exists throw exceptionintcountAll()Retrieves the number of rows of the table.intcountUsingTemplate(B bean) count the number of elements of a specific beanintcountUsingTemplate(B bean, int searchType) count the number of elements of a specific bean given the search typeintcountWhere(String where) Retrieves the number of rows of the table with a 'where' clause.Creates a new B instance.intDelete row according to primary keys of bean.intDelete beans.intdelete(Collection<B> beans) Delete beans.intDeletes all rows from table.intdeleteByPrimaryKey(Object... keys) Delete row according to its primary keys.intdeleteByWhere(String where) Deletes rows from the table using a 'where' clause.intdeleteUsingTemplate(B bean) Deletes rows using a template.booleanexistsByPrimaryKey(B bean) Returns true if this table contains row specified by primary key fields of B.
when you don't know which is primary key of table,you can use the method.booleanexistsPrimaryKey(Object... keys) Returns true if this table contains row with primary key fields.fastInsert(int[] fieldList, C beans) Insert the B bean list into the database.voidforeach(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.voidforeachByJoinWhere(TableManager.DoEach<B> each, boolean stopOnError, String join, String where) Retrieves each row of B bean given a SQL where clause and a list of fields, and dealt with each action.voidforeachByWhere(TableManager.DoEach<B> each, boolean stopOnError, String where) Retrieves each row of B bean given a SQL where clause and a list of fields, and dealt with each action.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.intloadAll(int startRow, int numRows, TableManager.Action<B> action) Loads the given number of rows from table, given the start row and dealt with action.intloadAll(TableManager.Action<B> action) Loads each row from table and dealt with action.Loads all the rows from table.loadAllAsList(int startRow, int numRows) Loads the given number of rows from table, given the start row.loadByJoinWhereAsList(String join, String where) Retrieves a list of B bean given a sql 'where' clause.loadByJoinWhereAsList(String join, 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.loadByJoinWhereAsList(String join, String where, Object[] argList, int[] fieldList) Retrieves a list of B bean given a sql where clause, and a list of fields.<T> List<T>loadByJoinWhereAsList(String join, String where, 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.intloadByJoinWhereForAction(String join, String where, 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.loadByPrimaryKey(B bean) Loads a B bean from the table using primary key fields ofbean.loadByPrimaryKey(Object... keys) Loads a B bean from the table using primary key fields.loadByPrimaryKeyChecked(B bean) see alsoloadByPrimaryKey(BaseBean)loadByPrimaryKeyChecked(Object... keys) see alsoloadByPrimaryKey(Object...)B[]loadByWhere(String where) Retrieves an array of B given a sql 'where' clause.B[]loadByWhere(String where, int[] fieldList) Retrieves an array of B bean given a sql where clause, and a list of fields.B[]loadByWhere(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.intloadByWhere(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.intloadByWhere(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.intloadByWhere(String where, TableManager.Action<B> action) Retrieves each row of B bean given a sql 'where' clause and dealt with action.loadByWhereAsList(String where) Retrieves a list of B bean given a sql 'where' clause.loadByWhereAsList(String where, int[] fieldList) Retrieves a list of B bean given a sql where clause, and a list of fields.loadByWhereAsList(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.intloadByWhereForAction(String where, 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> List<T>loadColumnAsList(String column, boolean distinct, String where, int startRow, int numRows) Load column from table.loadUniqueUsingTemplate(B bean) Loads a unique B bean from a template one giving a cLoads a unique B bean from a template one giving a cB[]loadUsingTemplate(B bean) Loads an array of B from a template one.intloadUsingTemplate(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.intloadUsingTemplate(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.intloadUsingTemplate(B bean, TableManager.Action<B> action) Loads each row from a template one and dealt with action.loadUsingTemplateAsList(B bean) Loads a list of B bean from a template one.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.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.voidregisterListener(TableListener<B> listener) introwCountWhere(String where, Object... argList) Retrieves the number of rows of the table with a 'where' clause.Saves the B bean into the database.B[]Saves an array of B bean into the database.<C extends Collection<B>>
Csave(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 Collection<B>>
CsaveAsTransaction(C beans) Saves a collection of B bean into the database.booleansetValueIfNonEqual(B bean, String column, Object value) set a value to the given field in bean if value is not equal to the given field of old record in databasebooleansetValueIfNonNull(B bean, String column, Object value) set a value to the given field in bean if the given field of old record in database is not nullvoidunregisterListener(TableListener<B> listener) remove listener.从接口继承的方法 gu.sql2java.SqlRunner
rowCountOf, runAsTransaction, runAsTransaction, runSql, runSql, runSqlAsList, runSqlAsList, runSqlAsList, runSqlForMap, runSqlForValue, runWithNoPage, runWithNoPage
-
方法详细资料
-
createBean
B createBean()Creates a new B instance.- 返回:
- the new B instance
-
countAll
Retrieves the number of rows of the table.- 返回:
- the number of rows returned
- 抛出:
RuntimeDaoException
-
countUsingTemplate
count the number of elements of a specific bean- 参数:
bean- the bean to look for ant count- 返回:
- the number of rows returned
- 抛出:
RuntimeDaoException
-
countUsingTemplate
count the number of elements of a specific bean given the search type- 参数:
bean- the template to look forsearchType- exact ? like ? starting like ? ending link ?
0Constant.SEARCH_EXACT
1Constant.SEARCH_LIKE
2Constant.SEARCH_STARTING_LIKE
3Constant.SEARCH_ENDING_LIKE- 返回:
- the number of rows returned
- 抛出:
RuntimeDaoException
-
countWhere
Retrieves the number of rows of the table with a 'where' clause. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
where- the restriction clause- 返回:
- the number of rows returned
- 抛出:
RuntimeDaoException
-
rowCountWhere
Retrieves the number of rows of the table with a 'where' clause. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
where- the restriction clauseargList- the arguments to use fill given prepared statement,may be null- 返回:
- the number of rows returned
- 抛出:
RuntimeDaoException
-
deleteAll
Deletes all rows from table.- 返回:
- the number of deleted rows.
- 抛出:
RuntimeDaoException
-
deleteByWhere
Deletes rows from the table using a 'where' clause. It is up to you to pass the 'WHERE' in your where clauses.
Attention, if 'WHERE' is omitted it will delete all records.- 参数:
where- the sql 'where' clause- 返回:
- the number of deleted rows
- 抛出:
RuntimeDaoException
-
deleteUsingTemplate
Deletes rows using a template.- 参数:
bean- the template object(s) to be deleted- 返回:
- the number of deleted objects
- 抛出:
RuntimeDaoException
-
deleteByPrimaryKey
Delete row according to its primary keys.- 参数:
keys- primary keys value
for fd_face table
PK# 1 fd_face.id type Integer
for fd_feature table
PK# 1 fd_feature.md5 type String
for fd_image table
PK# 1 fd_image.md5 type String
for fd_store table
PK# 1 fd_store.md5 type String- 返回:
- the number of deleted rows
- 抛出:
RuntimeDaoException
-
delete
Delete row according to primary keys of bean.- 参数:
bean- will be deleted ,all keys must not be null- 返回:
- the number of deleted rows,0 returned if bean is null
- 抛出:
RuntimeDaoException
-
delete
Delete beans.- 参数:
beans- B array will be deleted- 返回:
- the number of deleted rows
- 抛出:
RuntimeDaoException
-
delete
Delete beans.- 参数:
beans- B collection will be deleted- 返回:
- the number of deleted rows
- 抛出:
RuntimeDaoException
-
setValueIfNonNull
set a value to the given field in bean if the given field of old record in database is not null- 参数:
bean-column- column namevalue-- 返回:
- true if not equal with old record in database,otherwise false
- 从以下版本开始:
- 3.15.4
-
setValueIfNonEqual
set a value to the given field in bean if value is not equal to the given field of old record in database- 参数:
bean-column- column namevalue-- 返回:
- true if not equal with old record in database,otherwise false
- 从以下版本开始:
- 3.15.4
-
loadAll
Loads all the rows from table.- 返回:
- an array of B bean
- 抛出:
RuntimeDaoException
-
loadAll
Loads each row from table and dealt with action.- 参数:
action- Action object for do something(not null)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadAll
Loads the given number of rows from table, given the start row.- 参数:
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)- 返回:
- an array of B bean
- 抛出:
RuntimeDaoException
-
loadAll
Loads the given number of rows from table, given the start row and dealt with action.- 参数:
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)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadAllAsList
Loads all the rows from table.- 返回:
- a list of B bean
- 抛出:
RuntimeDaoException
-
loadAllAsList
Loads the given number of rows from table, given the start row.- 参数:
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)- 返回:
- a list of B bean
- 抛出:
RuntimeDaoException
-
loadByPrimaryKey
Loads a B bean from the table using primary key fields ofbean.- 参数:
bean- the B bean with primary key fields- 返回:
- a unique B or
nullif not found or bean is null - 抛出:
RuntimeDaoException
-
loadByPrimaryKeyChecked
see alsoloadByPrimaryKey(BaseBean)- 参数:
bean-- 返回:
- a unique B ,otherwise throw exception
- 抛出:
ObjectRetrievalException- not foundRuntimeDaoException
-
loadByPrimaryKey
Loads a B bean from the table using primary key fields. when you don't know which is primary key of table,you can use the method.- 参数:
keys- primary keys value:
for fd_face table
PK# 1 fd_face.id type Integer
for fd_feature table
PK# 1 fd_feature.md5 type String
for fd_image table
PK# 1 fd_image.md5 type String
for fd_store table
PK# 1 fd_store.md5 type String- 返回:
- a unique B or
nullif not found - 抛出:
RuntimeDaoException
-
loadByPrimaryKeyChecked
see alsoloadByPrimaryKey(Object...)- 参数:
keys-- 返回:
- a unique B,otherwise throw exception
- 抛出:
ObjectRetrievalException- not foundRuntimeDaoException
-
existsPrimaryKey
Returns true if this table contains row with primary key fields.- 参数:
keys- primary keys value- 抛出:
RuntimeDaoException- 另请参阅:
-
existsByPrimaryKey
Returns true if this table contains row specified by primary key fields of B.
when you don't know which is primary key of table,you can use the method.- 参数:
bean- the B bean with primary key fields- 抛出:
RuntimeDaoException- 另请参阅:
-
checkDuplicate
Check duplicated row by primary keys,if row exists throw exception- 参数:
bean- the B bean with primary key fields- 返回:
- always bean
- 抛出:
ObjectRetrievalException- has duplicated recordRuntimeDaoException- 另请参阅:
-
loadByWhere
Retrieves an array of B given a sql 'where' clause.- 参数:
where- the sql 'where' clause- 抛出:
RuntimeDaoException
-
loadByWhere
Retrieves each row of B bean given a sql 'where' clause and dealt with action.- 参数:
where- the sql 'where' clauseaction- Action object for do something(not null)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadByWhere
Retrieves an array of B bean given a sql where clause, and a list of fields. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
where- the sql 'WHERE' clausefieldList- array of field's ID- 抛出:
RuntimeDaoException
-
loadByWhere
int loadByWhere(String where, int[] fieldList, TableManager.Action<B> action) throws RuntimeDaoException Retrieves each row of B bean given a sql where clause, and a list of fields, and dealt with action. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
where- the sql 'WHERE' clausefieldList- array of field's IDaction- Action object for do something(not null)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadByWhere
B[] loadByWhere(String where, int[] fieldList, int startRow, int numRows) throws RuntimeDaoException Retrieves an array of B bean given a sql where clause and a list of fields, and startRow and numRows. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
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)- 抛出:
RuntimeDaoException
-
loadByWhere
int loadByWhere(String where, int[] fieldList, int startRow, int numRows, TableManager.Action<B> action) throws RuntimeDaoException Retrieves each row of B bean given a sql where clause and a list of fields, and startRow and numRows, and dealt with action. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
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)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadByWhereAsList
Retrieves a list of B bean given a sql 'where' clause.- 参数:
where- the sql 'where' clause- 抛出:
RuntimeDaoException
-
loadByJoinWhereAsList
Retrieves a list of B bean given a sql 'where' clause.- 参数:
join- the sql 'join' clausewhere- the sql 'where' clause- 抛出:
RuntimeDaoException
-
loadByWhereAsList
Retrieves a list of B bean given a sql where clause, and a list of fields. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
where- the sql 'WHERE' clausefieldList- array of field's ID- 抛出:
RuntimeDaoException
-
loadByJoinWhereAsList
List<B> loadByJoinWhereAsList(String join, String where, Object[] argList, int[] fieldList) throws RuntimeDaoException Retrieves a list of B bean given a sql where clause, and a list of fields. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
join- the sql 'join' clausewhere- the sql 'WHERE' clauseargList- the arguments to use fill given prepared statement,may be nullfieldList- array of field's ID- 抛出:
RuntimeDaoException
-
loadByWhereAsList
List<B> loadByWhereAsList(String where, int[] fieldList, int startRow, int numRows) throws RuntimeDaoException Retrieves a list of B bean given a sql where clause and a list of fields, and startRow and numRows. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
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)- 抛出:
RuntimeDaoException
-
loadByJoinWhereAsList
List<B> loadByJoinWhereAsList(String join, String where, int[] fieldList, int startRow, int numRows) throws RuntimeDaoException Retrieves a list of B bean given a sql where clause and a list of fields, and startRow and numRows. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
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
-
loadByJoinWhereAsList
<T> List<T> loadByJoinWhereAsList(String join, String where, Object[] argList, int[] fieldList, int startRow, int numRows, com.google.common.base.Function<B, T> transformer) throws RuntimeDaoExceptionRetrieves a list of T bean given a sql where clause and a list of fields, and startRow and numRows. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
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 T- 抛出:
RuntimeDaoException
-
loadByWhereForAction
int loadByWhereForAction(String where, Object[] argList, int[] fieldList, int startRow, int numRows, TableManager.Action<B> action) throws RuntimeDaoException 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.- 参数:
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)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadByJoinWhereForAction
int loadByJoinWhereForAction(String join, String where, Object[] argList, int[] fieldList, int startRow, int numRows, TableManager.Action<B> action) throws RuntimeDaoException Retrieves each row of B bean given a sql where clause and a list of fields, and startRow and numRows, and dealt with action. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
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)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadUniqueUsingTemplate
Loads a unique B bean from a template one giving a c- 参数:
bean- the B bean to look for- 返回:
- the bean matching the template,or
nullif not found or null input argument - 抛出:
ObjectRetrievalException- more than one rowRuntimeDaoException
-
loadUniqueUsingTemplateChecked
Loads a unique B bean from a template one giving a c- 参数:
bean- the B bean to look for- 返回:
- the bean matching the template
- 抛出:
ObjectRetrievalException- not found or more than one rowRuntimeDaoException
-
loadUsingTemplate
Loads an array of B from a template one.- 参数:
bean- the B bean template to look for- 返回:
- all the B beans matching the template
- 抛出:
RuntimeDaoException
-
loadUsingTemplate
Loads each row from a template one and dealt with action.- 参数:
bean- the B bean template to look foraction- Action object for do something(not null)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadUsingTemplate
Loads an array of B bean from a template one, given the start row and number of rows.- 参数:
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)- 返回:
- all the B matching the template
- 抛出:
RuntimeDaoException
-
loadUsingTemplate
int loadUsingTemplate(B bean, int startRow, int numRows, TableManager.Action<B> action) throws RuntimeDaoException Loads each row from a template one, given the start row and number of rows and dealt with action.- 参数:
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)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadUsingTemplate
int loadUsingTemplate(B bean, int[] fieldList, int startRow, int numRows, int searchType, TableManager.Action<B> action) throws RuntimeDaoException Loads each row from a template one, given the start row and number of rows and dealt with action.- 参数:
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 ?
0Constant.SEARCH_EXACT
1Constant.SEARCH_LIKE
2Constant.SEARCH_STARTING_LIKE
3Constant.SEARCH_ENDING_LIKEaction- Action object for do something(not null)- 返回:
- the count dealt by action
- 抛出:
RuntimeDaoException
-
loadUsingTemplate
Loads a list of B bean from a template one, given the start row and number of rows.- 参数:
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 ?
0Constant.SEARCH_EXACT
1Constant.SEARCH_LIKE
2Constant.SEARCH_STARTING_LIKE
3Constant.SEARCH_ENDING_LIKE- 返回:
- all the B bean matching the template
- 抛出:
RuntimeDaoException
-
loadUsingTemplateAsList
Loads a list of B bean from a template one.- 参数:
bean- the B bean template to look for- 返回:
- all the B beans matching the template
- 抛出:
RuntimeDaoException
-
loadUsingTemplateAsList
Loads a list of B bean from a template one, given the start row and number of rows.- 参数:
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)- 返回:
- all the B bean matching the template
- 抛出:
RuntimeDaoException
-
loadUsingTemplateAsList
List<B> loadUsingTemplateAsList(B bean, int startRow, int numRows, int searchType) throws RuntimeDaoException Loads an array of B bean from a template one, given the start row and number of rows.- 参数:
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?
0Constant.SEARCH_EXACT
1Constant.SEARCH_LIKE
2Constant.SEARCH_STARTING_LIKE
3Constant.SEARCH_ENDING_LIKE- 返回:
- all the B beans matching the template
- 抛出:
RuntimeDaoException
-
foreachByWhere
void foreachByWhere(TableManager.DoEach<B> each, boolean stopOnError, String where) throws RuntimeDaoException Retrieves each row of B bean given a SQL where clause and a list of fields, and dealt with each action. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
each- DoForEach object for do something(not null)stopOnError- stop on errorwhere- the SQL 'where' clause, retrieves all rows ifnullor empty- 抛出:
RuntimeDaoException
-
foreachByJoinWhere
void foreachByJoinWhere(TableManager.DoEach<B> each, boolean stopOnError, String join, String where) throws RuntimeDaoException Retrieves each row of B bean given a SQL where clause and a list of fields, and dealt with each action. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
each- DoForEach object for do something(not null)stopOnError- stop on errorjoin- the sql 'join' clausewhere- the SQL 'where' clause, retrieves all rows ifnullor empty- 抛出:
RuntimeDaoException
-
foreach
Retrieves each row of B bean given a SQL where clause and a list of fields, and dealt with each action. It is up to you to pass the 'WHERE' in your where clauses.- 参数:
each- DoForEach object for do something(not null)stopOnError- stop on error- 抛出:
RuntimeDaoException
-
registerListener
- 参数:
listener-
-
unregisterListener
remove listener.- 参数:
listener-
-
save
Saves the B bean into the database.- 参数:
bean- the B bean to be saved- 返回:
- the inserted or updated bean,or null if bean is null
- 抛出:
RuntimeDaoException
-
addIfAbsent
If the specified key is not already exist, add it to database. This is equivalent to
except that the action is performed atomically .if (!existsByPrimaryKey(bean)) return insert(bean); else return loadByPrimaryKey(bean);- 参数:
bean- the B bean to be saved- 返回:
- the previous value exists in database, or saved bean if not exists bean ,
or
nullif bean isnull - 抛出:
RuntimeDaoException
-
save
Saves an array of B bean into the database.- 参数:
beans- the array of B bean to be saved- 返回:
- always beans saved
- 抛出:
RuntimeDaoException
-
saveAsTransaction
Saves a collection of B bean into the database.- 参数:
beans- the B bean table to be saved- 返回:
- alwarys beans saved
- 抛出:
RuntimeDaoException
-
saveAsTransaction
Saves an array of B bean into the database as transaction.- 参数:
beans- the B bean table to be saved- 返回:
- alwarys beans saved
- 抛出:
RuntimeDaoException- 另请参阅:
-
save
Saves a collection of B bean into the database as transaction.- 参数:
beans- the B bean table to be saved- 返回:
- alwarys beans saved
- 抛出:
RuntimeDaoException
-
fastInsert
Insert the B bean list into the database. no supportTableListener- 参数:
fieldList- table of the field's associated constants,if null as all fieldbeans- the B bean list to be saved- 抛出:
RuntimeDaoException- 从以下版本开始:
- 3.15.4
-
loadColumnAsList
<T> List<T> loadColumnAsList(String column, boolean distinct, String where, int startRow, int numRows) throws RuntimeDaoException Load column from table.- 参数:
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)- 返回:
- an list of column
- 抛出:
RuntimeDaoException
-
getListenerContainer
ListenerContainer<B> getListenerContainer()- 返回:
- ListenerContainer instance of current table manager
-
getDataSourceConfig
IDataSourceConfig getDataSourceConfig()- 返回:
- data source information
-
getGeometryDataCodec
GeometryDataCodec getGeometryDataCodec()- 返回:
- Geometry Data code/decode instance
- 从以下版本开始:
- 3.18.0
-