I have a entity hierarchy has single table for all subclasses strategy. And I want to use each properties - mapped @ManyToOne - as primarykey. When I put @Id annotation, I'm getting this error:
java.lang.ClassCastException: org.hibernate.mapping.SingleTableSubclass cannot be cast to org.hibernate.mapping.RootClass
So how can I provide to define all properties as identifier on discriminated hierarchy?