public final class SQLBeanBuilder extends Object
| 构造器和说明 |
|---|
SQLBeanBuilder(Class<?> beanClass) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
countAll()
无条件统计
|
String |
countAndByRouters(int... routers)
AND条件统计一个表的记录数
|
String |
countOrByRouters(int... routers)
OR条件统计一个表的记录数
|
String |
deleteByPk()
根据主键删除表记录
|
String |
deleteByRouters(int... routers)
根据指定的routers条件删除表中的记录
|
Class<?> |
getBeanClass() |
String |
insertAllPk(boolean insertPk)
插入所有字段
|
String |
insertAllWithoutPk()
插入所有字段,除主键外
|
String |
insertAllWithPk()
连同主键一起插入
|
String |
insertRoutersPk(boolean insertPk,
int... routers)
插入指定的routers字段
|
String |
insertRoutersWithoutPk(int... routers)
插入指定的字段,除主键外
|
String |
insertRoutersWithPk(int... routers)
插入指定的字段,连同id一起
|
String |
selectAll()
无条件查询所有字段
|
String |
selectAllByPk()
根据主键id查询所有字段
|
String |
selectAllByRoutersAnd(int... routers)
AND条件查询所有字段
|
String |
selectPartByPk(int... routers)
根据主键id查询所选字段
|
String |
selectPartByRoutersAnd(int[] selectColumnsRouters,
int... conditionRouters)
AND条件查询所选择的字段
|
void |
setBeanClass(Class<?> beanClass) |
String |
updateRoutersByPk(int... updateRouters)
根据主键跟新指定routers列
|
String |
updateRoutersByRouterArray(int[] updateRouters,
int[] conditionRouters)
根据指定的条件routers更新指定的routers列
|
String |
updateRoutersByRouters(int[] updateRouters,
int... conditionRouters)
同updateRoutersByRouterArray,参数类型换为不不定式
|
public SQLBeanBuilder(Class<?> beanClass)
public Class<?> getBeanClass()
public void setBeanClass(Class<?> beanClass)
public String countAll() throws SQLTableNotFoundException
StringSQLTableNotFoundExceptionpublic String countAndByRouters(int... routers) throws SQLTableNotFoundException
routers - 需要and哪些字段来统计记录数StringSQLTableNotFoundExceptionpublic String countOrByRouters(int... routers) throws SQLTableNotFoundException
routers - 需要or哪些字段来统计记录数StringSQLTableNotFoundExceptionpublic String selectPartByRoutersAnd(int[] selectColumnsRouters, int... conditionRouters) throws SQLTableNotFoundException
selectColumnsRouters - 需要查询的routerconditionRouters - and条件中的routerStringSQLTableNotFoundExceptionpublic String selectAllByRoutersAnd(int... routers) throws SQLTableNotFoundException
routers - and条件中含有的routerStringSQLTableNotFoundExceptionpublic String selectAll() throws SQLTableNotFoundException
StringSQLTableNotFoundExceptionpublic String selectAllByPk() throws SQLTableNotFoundException, NotSetPrimaryKeyException
public String selectPartByPk(int... routers) throws SQLTableNotFoundException, NotSetPrimaryKeyException
routers - 需要查询的字段routersStringSQLTableNotFoundExceptionNotSetPrimaryKeyExceptionpublic String insertRoutersPk(boolean insertPk, int... routers) throws SQLTableNotFoundException
insertPk - 是否插入主键routers - 指定插入的哪些字段,为空则插入所有字段StringSQLTableNotFoundExceptionpublic String insertAllPk(boolean insertPk) throws SQLTableNotFoundException
insertPk - 是否连同主键一起插入StringSQLTableNotFoundExceptionpublic String insertAllWithPk() throws SQLTableNotFoundException
StringSQLTableNotFoundExceptionpublic String insertAllWithoutPk() throws SQLTableNotFoundException
StringSQLTableNotFoundExceptionpublic String insertRoutersWithPk(int... routers) throws SQLTableNotFoundException
routers - 指定字段的routersStringSQLTableNotFoundExceptionpublic String insertRoutersWithoutPk(int... routers) throws SQLTableNotFoundException
routers - 指定字段的routersStringSQLTableNotFoundExceptionpublic String updateRoutersByRouterArray(int[] updateRouters, int[] conditionRouters) throws SQLTableNotFoundException, UpdateColumnNullException
updateRouters - 指定更新列conditionRouters - 指定更新条件StringSQLTableNotFoundExceptionUpdateColumnNullExceptionpublic String updateRoutersByRouters(int[] updateRouters, int... conditionRouters) throws SQLTableNotFoundException, UpdateColumnNullException
updateRouters - conditionRouters - StringSQLTableNotFoundExceptionUpdateColumnNullExceptionpublic String updateRoutersByPk(int... updateRouters) throws SQLTableNotFoundException, UpdateColumnNullException, UpdatePkNotExistException
updateRouters - 指定routers更新列StringSQLTableNotFoundExceptionUpdateColumnNullExceptionUpdatePkNotExistExceptionpublic String deleteByPk() throws SQLTableNotFoundException, DeletePkNotExistException
public String deleteByRouters(int... routers) throws SQLTableNotFoundException, DeleteSQLConditionsNullException
routers - StringSQLTableNotFoundExceptionDeleteSQLConditionsNullExceptionCopyright © 2017. All rights reserved.