类 DialectFactory
- java.lang.Object
-
- org.sagacity.sqltoy.dialect.DialectFactory
-
public class DialectFactory extends Object
- 版本:
- v1.0,Date:2014年12月11日
- 作者:
- zhongxuchen
-
-
字段概要
字段 修饰符和类型 字段 说明 protected org.slf4j.Loggerlogger定义日志
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 LongbatchUpdate(SqlToyContext sqlToyContext, SqlToyConfig sqlToyConfig, List dataSet, int batchSize, ReflectPropsHandler reflectPropsHandler, InsertRowCallbackHandler insertCallhandler, Boolean autoCommit, DataSource dataSource)Longdelete(SqlToyContext sqlToyContext, Serializable entity, DataSource dataSource)<T extends Serializable>
LongdeleteAll(SqlToyContext sqlToyContext, List<T> entities, int batchSize, DataSource dataSource, Boolean autoCommit)LongexecuteSql(SqlToyContext sqlToyContext, SqlToyConfig sqlToyConfig, QueryExecutor queryExecutor, Integer[] paramsTypes, Boolean autoCommit, DataSource dataSource)StoreResultexecuteStore(SqlToyContext sqlToyContext, SqlToyConfig sqlToyConfig, Object[] inParamsValue, Integer[] outParamsType, Class resultType, DataSource dataSource)voidfetchStream(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, StreamResultHandler streamResultHandler, DataSource dataSource)QueryResultfindByQuery(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, LockMode lockMode, DataSource dataSource)QueryResultfindPage(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, long pageNo, Integer pageSize, Boolean overPageToFirst, DataSource dataSource)QueryResultfindSkipTotalCountPage(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, long pageNo, Integer pageSize, DataSource dataSource)QueryResultfindTop(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, double topSize, DataSource dataSource)LonggetCountBySql(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, DataSource dataSource)static DialectFactorygetInstance()获取对象单例QueryResultgetRandomResult(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, Double randomCount, DataSource dataSource)List<ColumnMeta>getTableColumns(SqlToyContext sqlToyContext, String catalog, String schema, String tableName, DataSource dataSource)List<TableMeta>getTables(SqlToyContext sqlToyContext, String catalog, String schema, String tableName, DataSource dataSource)booleanisUnique(SqlToyContext sqlToyContext, UniqueExecutor uniqueExecutor, DataSource dataSource)<T extends Serializable>
Tload(SqlToyContext sqlToyContext, T entity, Class[] cascadeTypes, LockMode lockMode, DataSource dataSource)<T extends Serializable>
List<T>loadAll(SqlToyContext sqlToyContext, List<T> entities, Class[] cascadeTypes, LockMode lockMode, DataSource dataSource)Serializablesave(SqlToyContext sqlToyContext, Serializable entity, DataSource dataSource)LongsaveAll(SqlToyContext sqlToyContext, List<?> entities, int batchSize, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)LongsaveAllIgnoreExist(SqlToyContext sqlToyContext, List<?> entities, int batchSize, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)LongsaveOrUpdate(SqlToyContext sqlToyContext, Serializable entity, String[] forceUpdateProps, DataSource dataSource)LongsaveOrUpdateAll(SqlToyContext sqlToyContext, List<?> entities, int batchSize, String[] forceUpdateProps, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)Longupdate(SqlToyContext sqlToyContext, Serializable entity, String[] forceUpdateFields, boolean cascade, Class[] forceCascadeClass, HashMap<Class,String[]> subTableForceUpdateProps, DataSource dataSource)LongupdateAll(SqlToyContext sqlToyContext, List<?> entities, int batchSize, String[] uniqueFields, String[] forceUpdateFields, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)QueryResultupdateFetch(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, UpdateRowHandler updateRowHandler, DataSource dataSource)SerializableupdateSaveFetch(SqlToyContext sqlToyContext, Serializable entity, UpdateRowHandler updateRowHandler, String[] uniqueProps, DataSource dataSource)booleanwrapTreeTableRoute(SqlToyContext sqlToyContext, TreeTableModel treeModel, DataSource dataSource)
-
-
-
方法详细资料
-
getInstance
public static DialectFactory getInstance()
获取对象单例- 返回:
-
batchUpdate
public Long batchUpdate(SqlToyContext sqlToyContext, SqlToyConfig sqlToyConfig, List dataSet, int batchSize, ReflectPropsHandler reflectPropsHandler, InsertRowCallbackHandler insertCallhandler, Boolean autoCommit, DataSource dataSource)
- 参数:
sqlToyContext-sqlToyConfig-dataSet- 支持List- 、List
batchSize-reflectPropsHandler-insertCallhandler- 使用反调方式自己对rs进行处理autoCommit-dataSource-- 返回:
-
executeSql
public Long executeSql(SqlToyContext sqlToyContext, SqlToyConfig sqlToyConfig, QueryExecutor queryExecutor, Integer[] paramsTypes, Boolean autoCommit, DataSource dataSource)
- 参数:
sqlToyContext-sqlToyConfig-queryExecutor-paramsTypes-autoCommit-dataSource-- 返回:
-
isUnique
public boolean isUnique(SqlToyContext sqlToyContext, UniqueExecutor uniqueExecutor, DataSource dataSource)
- 参数:
sqlToyContext-uniqueExecutor-dataSource-- 返回:
-
getRandomResult
public QueryResult getRandomResult(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, Double randomCount, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-randomCount-dataSource-- 返回:
-
wrapTreeTableRoute
public boolean wrapTreeTableRoute(SqlToyContext sqlToyContext, TreeTableModel treeModel, DataSource dataSource)
- 参数:
sqlToyContext-treeModel-dataSource-- 返回:
-
findSkipTotalCountPage
public QueryResult findSkipTotalCountPage(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, long pageNo, Integer pageSize, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-pageNo-pageSize-dataSource-- 返回:
-
findPage
public QueryResult findPage(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, long pageNo, Integer pageSize, Boolean overPageToFirst, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-pageNo-pageSize-overPageToFirst-dataSource-- 返回:
-
findTop
public QueryResult findTop(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, double topSize, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-topSize-dataSource-- 返回:
-
findByQuery
public QueryResult findByQuery(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, LockMode lockMode, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-lockMode-dataSource-- 返回:
-
getCountBySql
public Long getCountBySql(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-dataSource-- 返回:
-
saveOrUpdate
public Long saveOrUpdate(SqlToyContext sqlToyContext, Serializable entity, String[] forceUpdateProps, DataSource dataSource)
- 参数:
sqlToyContext-entity-forceUpdateProps-dataSource-- 返回:
-
saveOrUpdateAll
public Long saveOrUpdateAll(SqlToyContext sqlToyContext, List<?> entities, int batchSize, String[] forceUpdateProps, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)
- 参数:
sqlToyContext-entities-batchSize-forceUpdateProps-reflectPropsHandler-dataSource-autoCommit-
-
saveAllIgnoreExist
public Long saveAllIgnoreExist(SqlToyContext sqlToyContext, List<?> entities, int batchSize, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)
- 参数:
sqlToyContext-entities-batchSize-reflectPropsHandler-dataSource-autoCommit-
-
load
public <T extends Serializable> T load(SqlToyContext sqlToyContext, T entity, Class[] cascadeTypes, LockMode lockMode, DataSource dataSource)
- 参数:
sqlToyContext-entity-cascadeTypes-lockMode-dataSource-- 返回:
-
loadAll
public <T extends Serializable> List<T> loadAll(SqlToyContext sqlToyContext, List<T> entities, Class[] cascadeTypes, LockMode lockMode, DataSource dataSource)
- 参数:
sqlToyContext-entities-cascadeTypes-lockMode-dataSource-- 返回:
-
save
public Serializable save(SqlToyContext sqlToyContext, Serializable entity, DataSource dataSource)
- 参数:
sqlToyContext-entity-dataSource-- 返回:
-
saveAll
public Long saveAll(SqlToyContext sqlToyContext, List<?> entities, int batchSize, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)
- 参数:
sqlToyContext-entities-batchSize-reflectPropsHandler-dataSource-autoCommit-
-
update
public Long update(SqlToyContext sqlToyContext, Serializable entity, String[] forceUpdateFields, boolean cascade, Class[] forceCascadeClass, HashMap<Class,String[]> subTableForceUpdateProps, DataSource dataSource)
- 参数:
sqlToyContext-entity-forceUpdateFields-cascade-forceCascadeClass-subTableForceUpdateProps-dataSource-- 返回:
-
updateSaveFetch
public Serializable updateSaveFetch(SqlToyContext sqlToyContext, Serializable entity, UpdateRowHandler updateRowHandler, String[] uniqueProps, DataSource dataSource)
- 参数:
sqlToyContext-entity-updateRowHandler-uniqueProps- 空则表示根据主键查询dataSource-- 返回:
-
updateAll
public Long updateAll(SqlToyContext sqlToyContext, List<?> entities, int batchSize, String[] uniqueFields, String[] forceUpdateFields, ReflectPropsHandler reflectPropsHandler, DataSource dataSource, Boolean autoCommit)
- 参数:
sqlToyContext-entities-batchSize-uniqueFields- 唯一性索引字段forceUpdateFields-reflectPropsHandler-dataSource-autoCommit-- 返回:
-
delete
public Long delete(SqlToyContext sqlToyContext, Serializable entity, DataSource dataSource)
- 参数:
sqlToyContext-entity-dataSource-- 返回:
-
deleteAll
public <T extends Serializable> Long deleteAll(SqlToyContext sqlToyContext, List<T> entities, int batchSize, DataSource dataSource, Boolean autoCommit)
- 类型参数:
T-- 参数:
sqlToyContext-entities-batchSize-dataSource-autoCommit-- 返回:
-
updateFetch
public QueryResult updateFetch(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, UpdateRowHandler updateRowHandler, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-updateRowHandler-dataSource-- 返回:
-
executeStore
public StoreResult executeStore(SqlToyContext sqlToyContext, SqlToyConfig sqlToyConfig, Object[] inParamsValue, Integer[] outParamsType, Class resultType, DataSource dataSource)
- 参数:
sqlToyContext-sqlToyConfig-inParamsValue-outParamsType-resultType-dataSource-- 返回:
-
fetchStream
public void fetchStream(SqlToyContext sqlToyContext, QueryExecutor queryExecutor, SqlToyConfig sqlToyConfig, StreamResultHandler streamResultHandler, DataSource dataSource)
- 参数:
sqlToyContext-queryExecutor-sqlToyConfig-streamResultHandler-dataSource-
-
getTableColumns
public List<ColumnMeta> getTableColumns(SqlToyContext sqlToyContext, String catalog, String schema, String tableName, DataSource dataSource)
- 参数:
sqlToyContext-catalog-schema-tableName-dataSource-- 返回:
-
getTables
public List<TableMeta> getTables(SqlToyContext sqlToyContext, String catalog, String schema, String tableName, DataSource dataSource)
- 参数:
sqlToyContext-catalog-schema-tableName-dataSource-- 返回:
-
-