BeanUtilExtend类的详解
1.位置: com.cnaec.common.BeanUtilExtend.java
2.方法:
1. public static Object toHexString(string s)
将字符{"'","&","\"","#","%","[","]"}替换成
{"’","&",""","#","%","【","】"}
2. public static Object toHexString2(String s)
在like语句中字符替换
将字符{"'","%","_","!"}替换成
{"''","!%","!_","!!"}
3. public static Object hexString2String(String s)
字符替换,与toHexString2实现相反
将字符{"''","!%","!_","!!"}替换成
{"'","%","_","!"}
4. public void copyProperties(Object dest, Object orig, String strFlag)
throws IllegalAccessException, InvocationTargetException
dest和orig为null时,抛出异常IllegalArgumentException
strFlag为null时,字符替换方法为toHexString(str)
strFlag为Constant.BeanUtilExtend.AddOrUpdate时,字符不替换
strFlag为Constant.BeanUtilExtend.Query时,字符替换方法为toHexString2
strFlag为Constant.BeanUtilExtend.Back时,字符替换方法为toHexString2
5. public static void copyNotNullProperties(Object dest, Object orig)
throws IllegalAccessException, InvocationTargetException
非空属性拷贝
6. public static void copyTrimProperties(Object dest, Object orig)
属性去前后空格的拷贝,仅限于String
7. public static void myCopyPropertiesBack(Object dest, Object orig)
数据copy时,对查询myCopyProperties Query 过滤字符的回滚
8. public static void myCopyFormList(ListObject dest, ListObject orig)
将orig的formList数据复制到dest的formList中
9. public static void myCopyProperties(Object dest, Object orig)
将orig对象属性拷贝到dest属性中,拷贝中的字符替换使用toHexString()
10. public static void myCopyProperties(Object dest, Object orig, String strFlag)
将orig对象属性拷贝到dest对象中,拷贝中的字符替换使用toHexString()