[FIX] Correct Exception types in the DataJson Add-on

This commit is contained in:
Edouard DUPIN 2024-06-02 13:11:25 +02:00
parent d46b84c741
commit f6f256c006

View File

@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType; import java.lang.reflect.ParameterizedType;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types; import java.sql.Types;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -26,6 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
@ -53,7 +55,7 @@ public class AddOnDataJson implements DataAccessAddOn {
@Override @Override
public void insertData(final PreparedStatement ps, final Field field, final Object rootObject, final CountInOut iii) public void insertData(final PreparedStatement ps, final Field field, final Object rootObject, final CountInOut iii)
throws Exception { throws IllegalArgumentException, IllegalAccessException, SQLException, JsonProcessingException {
final Object data = field.get(rootObject); final Object data = field.get(rootObject);
if (data == null) { if (data == null) {
ps.setNull(iii.value, Types.VARCHAR); ps.setNull(iii.value, Types.VARCHAR);
@ -70,7 +72,7 @@ public class AddOnDataJson implements DataAccessAddOn {
} }
@Override @Override
public boolean isInsertAsync(final Field field) throws Exception { public boolean isInsertAsync(final Field field) {
return false; return false;
} }