public class ReflectionUtil extends Object
| 构造器和说明 |
|---|
ReflectionUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
getEntityInfo()
获取实体类信息
|
static boolean |
hasId(Object instance)
对象是否存在id
|
static com.alibaba.fastjson.JSONArray |
mappingResultSetToJSONArray(ResultSet resultSet,
int count)
映射结果集到JSONArray中
|
static <T> List<T> |
mappingSingleResultToList(ResultSet resultSet,
int count,
Class<T> _class)
将ResultSet映射到List中
|
static String |
setValueWithInsertIgnore(PreparedStatement ps,
Object instance,
String sql)
直接插入
为prepareStatement赋值
返回实际执行的SQL语句
|
static String |
setValueWithUpdateById(PreparedStatement ps,
Object instance,
String sql)
根据id更新
为prepareStatement赋值
|
static String |
setValueWithUpdateByUniqueKey(PreparedStatement ps,
Object instance,
String sql)
根据UniqueKey更新
为prepareStatement赋值
|
public static boolean hasId(Object instance) throws IllegalAccessException
public static String setValueWithInsertIgnore(PreparedStatement ps, Object instance, String sql) throws SQLException, IllegalAccessException
public static String setValueWithUpdateById(PreparedStatement ps, Object instance, String sql) throws SQLException, IllegalAccessException, NoSuchFieldException
public static String setValueWithUpdateByUniqueKey(PreparedStatement ps, Object instance, String sql) throws SQLException, IllegalAccessException
public static <T> List<T> mappingSingleResultToList(ResultSet resultSet, int count, Class<T> _class) throws SQLException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException
public static com.alibaba.fastjson.JSONArray mappingResultSetToJSONArray(ResultSet resultSet, int count) throws SQLException
SQLExceptionpublic static void getEntityInfo()
throws ClassNotFoundException,
IOException
Copyright © 2019. All rights reserved.