-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Cannot instantiate abstract class or interface
PostPosted: Thu May 28, 2009 4:36 am 
Newbie

Joined: Thu May 28, 2009 4:26 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.