After lots of testing, trying to get Java parameterisation working with an abstract parent (Single-table inheritance), and an abstract child table (one-table-per-class inheritance), I've given up.
It may be possible in simple instances, but often you get problems where Hibernate tries to instantiate an abstract (parameterised) class as an entity, which is where your error appears.
I would suggest rewriting it using the JPA inheritance, moving the parameterised stuff down into extending classes. That way you get the same polymorphism back from the database.
In either case, make your abstract classes @MappedSuperclass, not @Entity, then hibernate won't try and create Entities for them.
Code:
@MappedSuperclass
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "CLASS_TYPE", discriminatorType = DiscriminatorType.STRING)
public abstract class ClassA {
[...]
}
extension B:
Code:
@Entity
@DiscriminatorValue=("B")
public class ClassB extends ClassA {
@OneToOne
@JoinColumn(name = "mycolumn_id")
private Integer instance;
[...]
}
extension C:
Code:
@Entity
@DiscriminatorValue=("C")
public class ClassC extends ClassA {
@OneToOne
@JoinColumn(name = "mycolumn_id")
private String instance;
[...]
}