Sharon. wrote:
Thanks for your answer.
Is there any clever idea that can have entity with genric?
Hibernate creates its mappings on startup (creation of the sessionFactory) that is.
At that time there is no information about the Type parameter left except its erasure. So in order for Hibernate to be able to use this the erasure must be some Hibernate Entity.
So if you use type parameters like <T extends SomeEntity> for references, what Hibernate sees is (AFAIK) 'SomeEntity'. So if it knows how to map those it should be able to performe the mapping.