0 Replies Latest reply on Jul 15, 2008 2:35 PM by Arisson Leal

    EJB-DI + Generics !!

    Arisson Leal Newbie

      I have the following code:

      public abstract class CrudGenericBean<K extends Serializable, Entity> {
          private CrudFacade<K, Entity> crudFacade;

      public class UserBean extends CrudGenericBean<Long,User> {

      public interface CrudFacade<K, E> {   
          void create(E e);

      public class CrudFacadeImpl<K, E> implements CrudFacade<K, E> {
          public void create(E e){

      How can I inject the crudFacade, setting the generics types ?
      It's possible do this using DI ?

      private CrudFacade<K, Entity> pmfCrudFacade;

      If not, there's another way to do this ?
      For example using Component.getInstance(...) ??

      Something that work like this:

      private CrudFacade<K, Entity> myCrudFacade = new CrudFacade()<K, Entity>;