| | |
| | | |
| | | @Log4j |
| | | public class ExampleUtil { |
| | | private final static String OR_SPLIT = "or\\|"; |
| | | private final static String CRITERIA_SPLIT = "\\|\\|\\|"; |
| | | private final static String CONDITION_SPLIT = "\\|\\|"; |
| | | private final static String SPLIT = "\\|"; |
| | | private final static String OR = "_OR"; |
| | | private final static String OR_SPLIT = OR+SPLIT; |
| | | private final static String CRITERIA = "_CR"; |
| | | private final static String CRITERIA_SPLIT = CRITERIA+SPLIT; |
| | | private final static String CONDITION = "_CO"; |
| | | private final static String CONDITION_SPLIT = CONDITION+SPLIT; |
| | | private static Map<String, Method> criteriaMethodMap = new ConcurrentHashMap<>(); |
| | | private static void setOrderByClause(Example example,String orderByClause) throws UnsupportedEncodingException, NoSuchFieldException { |
| | | orderByClause = URLDecoder.decode(orderByClause,"UTF-8"); |
| | |
| | | } |
| | | if(!StringUtils.isNullOrEmpty(params)){ |
| | | params = URLDecoder.decode(params, "UTF-8"); |
| | | if (params.startsWith("or|")) { |
| | | if (params.startsWith(OR)) { |
| | | String[] criteria = params.trim().split(OR_SPLIT); |
| | | for (String criterion : criteria) { |
| | | // criterion为null或""跳过 |