Thank you JHaberlin,
now the problem is well explained.
The main question IMHO is whether hibernate supports generalizations (with type parameter T ) in annotated entities
like you do here:
Code:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public abstract class Vehicle<T extends VehicleType> extends BaseEntity
In theory Hibernate would have to instantiate each Vehicle twice when loading a record from db.
First Hibernate cannot know the value of parameter T and must guess to instantiate a new Vehicle object,
only after having read Vehicle.typeID=4 hibernate in theory could create a new Vehicle with correct parameter T (new Vehicle<MotorcycleType>) but I really assume that such mechanism is not provided in Hibernate.
Did you read somewhere that Hibernate supports generalizations (with type parameter T ) in annotated entities ?