[FEAT] assert when try to insart null data

This commit is contained in:
Edouard DUPIN 2025-01-25 12:16:39 +01:00
parent 0d419f651e
commit 8f3c14e28d

View File

@ -815,6 +815,9 @@ public class DBAccessSQL extends DBAccess {
@Override
@SuppressFBWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
public <T> T insert(final T data, final QueryOption... option) throws Exception {
if (data == null) {
throw new DataAccessException("Try to check a null data ==> wrong API");
}
final Class<?> clazz = data.getClass();
final QueryOptions options = new QueryOptions(option);