コード例 #1
0
  private static void parseCondition(
      String action, String desc, final List<Object> params, final StringBuilder sb) {
    if (!CommonUtil.isBlank(action)) {
      if (sb.length() > 0) sb.append(" and ");

      sb.append("action like ?");
      params.add(new StringBuilder("%").append(action.trim()).append("%").toString());
    }

    if (!CommonUtil.isBlank(desc)) {
      if (sb.length() > 0) sb.append(" and ");

      sb.append("description like ?");
      params.add(new StringBuilder("%").append(desc.trim()).append("%").toString());
    }
  }
コード例 #2
0
  private static Permission findByAction(String action) {
    if (CommonUtil.isBlank(action)) return null;

    return Permission.find("byAction", action.trim()).first();
  }