To a lot of problems with @MappedSuperclass with generics.
We have:
@MappedSuperclass public class AbstractEntity<ID extends Serializable> { @Id @GeneratedValue protected ID id; ...
And we have:
@Entity @Table(name = "SomeEntity") public class SomeEntity extends AbstractEntity<Integer> { }
Next, jpa criteria:
public Predicate toPredicate(Root root, CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) { {color:red}//Here we have - Serializable, but expected Integer.{color} root.get("id").getJavaType(); return ...; }
If the generic parameter is just type, we have Object at getJavaType().