Hi, I'm new with Hibernate 3 and I have a problem.
I've an abstract class with other two subclasses who depends form this abstract class. I'm using annotations to relation with the database. Here I put the code:
Abstract class:
@Entity @Inheritance(strategy=InheritanceType. SINGLE_TABLE) @Table(name="t_use_case") @DiscriminatorColumn(name="TYPE",discriminatorType=DiscriminatorType. STRING,length=2) public abstract class UseCase {...}
Subclasses:
@Entity @DiscriminatorColumn(name="TYPE") @DiscriminatorValue("AN") public class AnalysisUseCase extends UseCase{...}
@Entity @DiscriminatorColumn(name="TYPE") @DiscriminatorValue("SU") public class SubfunctionUseCase extends UseCase{...}
When I want instantiate the class UseCase i have this error:
cause: org.springframework.orm. Hibernate3. HibernateSystemException: Cannot instantiate abstract class or interface: com.zentipede.up. Model. UseCase; nested exception is org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: com.zentipede.up. Model. UseCase
I think that it can be that the entities it is wrong (I don't think so) or something with proxy's).
Someone can help me about that?
Thanks a lot.
|