public class MybatisUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static char |
UNDERLINE
下划线
|
| 构造器和说明 |
|---|
MybatisUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
assertNotBlank(String property,
String value)
断言字符串不能为空
|
static void |
assertNotEmpty(String property,
Collection list)
断言list参数不能为空
|
static void |
assertNotEmpty(String property,
Map map)
断言list参数不能为空
|
static void |
assertNotEmpty(String property,
Object[] array)
断言数组array参数不能为空
|
static void |
assertNotNull(String property,
Object value)
断言对象不能为null
|
static <T> void |
assertNotNull(String property,
T value1,
T value2)
断言对象不能为null
|
static String |
camelToUnderline(String string,
boolean toUpper)
驼峰转下划线
|
static String |
capitalFirst(String name,
String del)
实体首字母大写
|
static String |
format(String target,
Object... params)
安全的进行字符串 format
|
static List<Field> |
getFieldList(Class<?> clazz)
获取该类的所有属性列表
|
static Class<?> |
getProxyTargetClass(Class<?> clazz)
获取代理对象的target class
|
static String |
getVersionBanner()
fluent mybatis version
|
static <O> boolean |
isCollection(O... args) |
static boolean |
isColumnName(String input)
判断是否是数据库表字段名称
非全数字, 只包含数字+字母+下划线组成
|
static boolean |
isDigit(char ch)
数字
|
static boolean |
isLetter(char ch)
字母 a-z, A-Z, 或 '_'
|
static boolean |
isSpace(char ch) |
static void |
isTrue(boolean expression,
String message,
Object... params)
断言这个 boolean 为 true
为 false 则抛出异常
|
static String |
lowerFirst(String name,
String del)
实体首字母小写
|
static String |
methodNameOfEntity(String method,
Class entityClass)
relation属性关联查询方法名
|
static String |
methodNameOfEntity(String method,
String entityClass)
relation属性关联查询方法名
|
static RuntimeException |
notFluentMybatisException(Class clazz)
Entity Class不是@FluentMybatis注解类异常
|
static void |
notNull(Object object,
String message,
Object... params)
断言这个 object 不为 null
为 null 则抛异常
|
static String |
tableName(String klass,
String prefix,
String suffix)
获取表名
|
static Integer[] |
toArray(int[] nums) |
static Long[] |
toArray(long[] nums) |
static String |
trim(String str) |
static String |
underlineToCamel(String input,
boolean firstCapital)
下划线转驼峰命名
|
public static final char UNDERLINE
public static String format(String target, Object... params)
target - 目标字符串params - format 参数public static Class<?> getProxyTargetClass(Class<?> clazz)
获取代理对象的target class
clazz - 传入public static void assertNotNull(String property, Object value)
property - name of propertyvalue - objectpublic static <T> void assertNotNull(String property, T value1, T value2)
property - name of propertyvalue1 - objectvalue2 - objectpublic static void assertNotBlank(String property, String value)
property - name of propertyvalue - string valuepublic static void assertNotEmpty(String property, Collection list)
property - name of propertylist - objectspublic static void assertNotEmpty(String property, Map map)
property - name of propertymap - mappublic static void assertNotEmpty(String property, Object[] array)
property - name of propertyarray - objectspublic static void isTrue(boolean expression,
String message,
Object... params)
为 false 则抛出异常
expression - boolean 值message - 消息public static void notNull(Object object, String message, Object... params)
为 null 则抛异常
object - 对象message - 消息public static Integer[] toArray(int[] nums)
public static Long[] toArray(long[] nums)
public static <O> boolean isCollection(O... args)
public static String tableName(String klass, String prefix, String suffix)
klass - Entity类名称prefix - 表名称前缀suffix - Entity类后缀public static String camelToUnderline(String string, boolean toUpper)
string - 要转换的字符串toUpper - 统一转大写public static String underlineToCamel(String input, boolean firstCapital)
input - textfirstCapital - true: 首字母大写, false:首字母小写public static String capitalFirst(String name, String del)
name - 待转换的字符串del - 删除的前缀public static String lowerFirst(String name, String del)
name - 待转换的字符串del - 删除的前缀public static String methodNameOfEntity(String method, Class entityClass)
method - 属性(字段)名称entityClass - Entity类名public static String methodNameOfEntity(String method, String entityClass)
method - 属性(字段)名称entityClass - Entity类名public static RuntimeException notFluentMybatisException(Class clazz)
clazz - classpublic static boolean isColumnName(String input)
input - column namepublic static boolean isLetter(char ch)
ch - letterpublic static boolean isSpace(char ch)
public static boolean isDigit(char ch)
ch - letterpublic static String getVersionBanner()
Copyright © 2021. All rights reserved.