This is the function that I have currently. However, it is not returning anything.
public boolean authenticateDisabledRegions(int analystId, List<Integer> regionIds) {
Integer query = jdbcTemplate.queryForObject(
"select count(*) from ANALYST_REGION_MAPPING WHERE STATUS = 0 AND ANALYST_ID = ? AND REGION_ID = ?",
Integer.class, analystId, regionIds);
return query != null && query > 0;
}
I tried to do this but it does not seem to be working, I have been looking it up and there are a lot of suggestions that say fo the ResultSet rs with rs.next() I am just wondering what the best approach is for this type of function.
The purpose of this is to check whether it exists, if it does, it will call update (&change status), if not, it will call insert.