@Test @Sql(scripts = { "/sql/clearRole.sql", "/sql/insertRoleData.sql" }) public void testCheckRoleNameDuplicationValidationExist() { boolean exist = roleRepository.checkRoleNameDuplicationValidationErrors("SUPERUSER"); assertThat(exist == true); }
public boolean checkRoleNameDuplicationValidationErrors(String roleName) { final String query = RoleQueryBuilder.checkRoleNameDuplicationValidationErrors(); final Map<String, Object> parametersMap = new HashMap<String, Object>(); parametersMap.put("name", roleName); SqlRowSet sqlRowSet = namedParameterJdbcTemplate.queryForRowSet(query, parametersMap); if (sqlRowSet != null && sqlRowSet.next() && sqlRowSet.getString("code") != null && sqlRowSet.getString("code") != "") { return true; } return false; }
RoleRepository { public boolean checkRoleNameDuplicationValidationErrors(String roleName) { final String query = RoleQueryBuilder.checkRoleNameDuplicationValidationErrors(); final Map<String, Object> parametersMap = new HashMap<String, Object>(); parametersMap.put("name", roleName); SqlRowSet sqlRowSet = namedParameterJdbcTemplate.queryForRowSet(query, parametersMap); if (sqlRowSet != null && sqlRowSet.next() && sqlRowSet.getString("code") != null && sqlRowSet.getString("code") != "") { return true; } return false; } }
RoleRepository { public boolean checkRoleNameDuplicationValidationErrors(String roleName) { final String query = RoleQueryBuilder.checkRoleNameDuplicationValidationErrors(); final Map<String, Object> parametersMap = new HashMap<String, Object>(); parametersMap.put("name", roleName); SqlRowSet sqlRowSet = namedParameterJdbcTemplate.queryForRowSet(query, parametersMap); if (sqlRowSet != null && sqlRowSet.next() && sqlRowSet.getString("code") != null && sqlRowSet.getString("code") != "") { return true; } return false; }  }
RoleRepository { public boolean checkRoleNameDuplicationValidationErrors(String roleName) { final String query = RoleQueryBuilder.checkRoleNameDuplicationValidationErrors(); final Map<String, Object> parametersMap = new HashMap<String, Object>(); parametersMap.put("name", roleName); SqlRowSet sqlRowSet = namedParameterJdbcTemplate.queryForRowSet(query, parametersMap); if (sqlRowSet != null && sqlRowSet.next() && sqlRowSet.getString("code") != null && sqlRowSet.getString("code") != "") { return true; } return false; }  List<Role> createRole(final RoleRequest roleRequest); List<Role> updateRole(final RoleRequest roleRequest); boolean checkRoleNameDuplicationValidationErrors(String roleName); List<Role> getAllMDMSRoles(RoleSearchCriteria roleSearchCriteria); static RequestInfo getRInfo(); }
RoleRepository { public boolean checkRoleNameDuplicationValidationErrors(String roleName) { final String query = RoleQueryBuilder.checkRoleNameDuplicationValidationErrors(); final Map<String, Object> parametersMap = new HashMap<String, Object>(); parametersMap.put("name", roleName); SqlRowSet sqlRowSet = namedParameterJdbcTemplate.queryForRowSet(query, parametersMap); if (sqlRowSet != null && sqlRowSet.next() && sqlRowSet.getString("code") != null && sqlRowSet.getString("code") != "") { return true; } return false; }  List<Role> createRole(final RoleRequest roleRequest); List<Role> updateRole(final RoleRequest roleRequest); boolean checkRoleNameDuplicationValidationErrors(String roleName); List<Role> getAllMDMSRoles(RoleSearchCriteria roleSearchCriteria); static RequestInfo getRInfo(); static final Logger LOGGER; }