I've been using a
 public class BaseHome extends EntityHome<Base>
class to manage persistence for a collection of sub class entities that inherit 
from Base. 

For sub classes which have been persisted to the database things work as 
expected. I can setId(), getInstance(), and persist state changes to the 
database.

I would like to create new entities using BaseHome, but I need a way to specify 
which concrete subclass should be instantiated. Here's what I've tried to do:
public class BaseHome extends EntityHome<Base>
  | {
  |         @Override
  |         public void create()
  |         {
  |                 setEntityClass(Subclass.class);
  |                 super.create();
  |         }
  | }
  | 
  | public class Subclass extends Base{}
  | 
With the result:The method setEntityClass(Class<Base>)
  | in the type Home<EntityManager,Base>
  | is not applicable for the arguments (Class<Subclass>)

Am I using the EntityHome framework in a manner that was never intended? Should 
I  build my own bean for managing this object heirachy?

As always, I greatly appreciate the insights the members of this forum share.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046913#4046913

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046913
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to