Package com.objectsql.helper
Class SQLHelperCreator
java.lang.Object
com.objectsql.helper.SQLHelperCreator
数据库表工具类
Created by huangyonghua on 2016/2/16.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcreatePrimaryKeyValue(Options options, SQLHelper helper, List<String> ps, List<String> vs, ColumnInfo info, Object obj, Object fo) static SQLHelperstatic SQLHelper按对象的id删除static SQLHelperstatic SQLHelperdeleteBy(String schema, Class clazz, Options options, Expression[] expressions) static SQLHelper只允许IDstatic SQLHelper允许获取 id,匹配,唯一等值 有id根据id获取,其他根据列 等值获取static SQLHelperstatic <T> TnewClass(Class clazz, ResultSet rs, QueryHandler queryConvert, ResultSetHandler resultSetHandler) static <T> TnewClass(Class clazz, ResultSet rs, ResultSetHandler resultSetHandler) static SQLHelperquery(String schema, Options options, Class<?> clazz, Expression[] expressions) static SQLHelperqueryCount(String schema, Options options, Class<?> clazz, Condition condition) static SQLHelperqueryCountExpress(String schema, Options options, Class<?> clazz, Expression... expressions) static voidsetParameter(Options options, PreparedStatement ps, List<Pair> objects, Connection connection) static SQLHelperupdate(String schema, Options option, Object obj, Expression[] expressions, boolean updateNull, String[] nullColumns) 更新 只能使用id,否则初学者不填id 全部更新了。static SQLHelperupdateExpress(String schema, Class<?> clazz, Options options, Expression[] values, Expression[] conditions) static SQLHelperupdateTerms(String schema, Options option, Object obj, Condition condition, boolean updateNull, String[] nullColumns)
-
Field Details
-
generatorMap
-
-
Constructor Details
-
SQLHelperCreator
public SQLHelperCreator()
-
-
Method Details
-
delete
按对象的id删除- Parameters:
obj-- Returns:
- SQLHelper
-
delete
- Parameters:
clazz-idObject- id- Returns:
- SQLHelper
-
deleteBy
public static SQLHelper deleteBy(String schema, Class clazz, Options options, Expression[] expressions) -
deleteBy
-
updateTerms
-
update
public static SQLHelper update(String schema, Options option, Object obj, Expression[] expressions, boolean updateNull, String[] nullColumns) 更新 只能使用id,否则初学者不填id 全部更新了。- Parameters:
obj-expressions-updateNull-- Returns:
- SQLHelper
-
updateExpress
public static SQLHelper updateExpress(String schema, Class<?> clazz, Options options, Expression[] values, Expression[] conditions) -
insert
-
createPrimaryKeyValue
-
inserts
-
updates
-
get
允许获取 id,匹配,唯一等值 有id根据id获取,其他根据列 等值获取- Parameters:
obj-- Returns:
- SQLHelper
-
query
public static SQLHelper query(String schema, Options options, Class<?> clazz, Expression[] expressions) -
queryCountExpress
public static SQLHelper queryCountExpress(String schema, Options options, Class<?> clazz, Expression... expressions) -
queryCount
-
get
只允许ID- Parameters:
clazz-id-- Returns:
- SQLHelperCreator
-
newClass
public static <T> T newClass(Class clazz, ResultSet rs, ResultSetHandler resultSetHandler) throws IllegalAccessException, SQLException - Throws:
IllegalAccessExceptionSQLException
-
newClass
public static <T> T newClass(Class clazz, ResultSet rs, QueryHandler queryConvert, ResultSetHandler resultSetHandler) throws IllegalAccessException, SQLException - Throws:
IllegalAccessExceptionSQLException
-
setParameter
public static void setParameter(Options options, PreparedStatement ps, List<Pair> objects, Connection connection) throws SQLException - Throws:
SQLException
-