public void save(Privilege privilege) { // 唯一性判断 List uniquePropertyNames = new LinkedList(); uniquePropertyNames.add("privilName"); super.isUnique(true, privilege, uniquePropertyNames, X27Exception.privil_name_has_exist()); super.save(privilege); }
public void updatePrivilege(Privilege param) { /* * Privilege entity = findById(param.getIdStr()); Privilege example = new Privilege(); * example.setPrivilName(param.getPrivilName()); if ((!entity.getPrivilName().equals(param.getPrivilName())) && * (super.findListByExample(example).size() != 0)) { throw new X27Exception(X27Exception.PRIVILNAME_HAS_EXIST); } */ // 唯一性判断 List uniquePropertyNames = new LinkedList(); uniquePropertyNames.add("privilName"); super.isUnique(true, param, uniquePropertyNames, X27Exception.privil_name_has_exist()); super.updateByParam(param); }