Hi,
I have a problem using hibernate as a JPA provider.
I have a class hierarchy consisting of one abstract class and two subclasses that extend this abstract class. I have another class that containts a Set of the abstract class so it can contain instances of the two subclasses. Whenever I try to get the Set of classes I get a Persistence exception saying Hibernate can't instantiate an abstract class when it really should create instances of the subclasses.
I know there is a way using the native hibernate mapping xml file using the property abstract = "true", but I'm using the JPA orm.xml mapping file which you can't use such property.
Any suggestions about how to solve this problem ?
Thank you.
CR
Hibernate version: hibernate-3.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
javax.persistence.PersistenceException: org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: com.festina.tventas.app.dmo.Articulo
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:75)
Name and version of the database you are using:
mysql 5.0.41
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html