Код: Выделить всё
@Query(value = """
INSERT INTO users(id, customerId, locale) VALUES (:id, :customerId, :locale)
""", nativeQuery = true)
void create(@Param("id") Long id,
@Param("customerId") String customerId,
@Param("locale") String locale,
.........
profileRepository.create(
profile.getId(),
profile.getCustomerId(),
profile.getLocale())
java.lang.NullPointerException: невозможно вызвать «com.User.getCustomerId()», поскольку возвращаемое значение «com.User.getCustomerId()» равно нулю.
Как разрешить коду вставить пустое значение и запрос SQL для вставки NULL в качестве полезной нагрузки?
Подробнее здесь: https://stackoverflow.com/questions/791 ... id-because