JpaSystemException when calculating vote sum
There seems to be a breaking change between Hibernate 5.6 and 6.1 which causes an exception. The effected class VoteSum
uses two constructors, VoteSum(final String commentId, final int sum)
and VoteSum(final String commentId, final long sum)
. The second one casts sum
from Long
to Integer
which is needed because the database returns a BIGINT
which Hibernate maps to Long
. Now, Hibernate seems to use the wrong constructor.
Error
Request processing failed: org.springframework.orm.jpa.JpaSystemException: Error performing dynamic instantiation : net.particify.arsnova.comments.model.VoteSum] with root cause
java.lang.IllegalArgumentException: argument type mismatch
Regression-MR: !567 (merged)