Getting type safety conversion warning from below code.
List<Map<String, Object>> batchValues = new ArrayList<>(entity.size());
int[] noOfRecords = namedParameterJDBCTemplate.batchUpdate(updateQuery, batchValues.toArray(new Map[entity.size()]));
batchValues.toArray(new Map[entity.size()]) Type safety: The expression of type Map[] needs unchecked conversion to conform to Map[]
If I used @SuppressWarnings("unchecked")
this annotation on method level then it's resolved the issue.
What is the best solution to resolve the issue?