myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Apache Myfaces12 Codi Tomcat 7 - Transaction Problems
Date Wed, 20 Mar 2013 08:51:06 GMT


Problem with codi(1.0.5) Transactions and Java (1.6/1.7) generics.




Jpa2 (eclipslink 2.4)

Codi 1.0.5

Tomcat 7

OpenWebBeans 1


See Classes below

Problem is:



When we inject the Interface IpersonDao in the Service Class (PersonServerImpl) and do the


dao.delete(person) à No Transaction is openend and nothing happens!!!!!


doa.persist(person)à Transaction is opened and entity is saved.


Difference is that in the IpersonDaoSuperInterface the delete function contains generic arguments
and the persist fuction has a concrete Object (person). But we need the generic type for all
function in the IpersonDaoSuperInterface.


When we inject the Concrete Implementation of the dao (  @Inject private PersonDao dao) in
PersonServerImpl the delete function also works.



Why cant we inject the Dao Interface when we use java generics in the interface hierarchy???




Service Class:


public class PersonServerImpl implements PersonService




  private IPersonDao dao;


  public void removePerson(Person person)





  public Person savePerson(Person person)


    return dao.persist(person);





Dao Class:


public class PersonDao implements IPersonDao



  public void delete(Person entity)





  public Person persist(Person entity)



    return entity;






IpersonDao Interface:


public interface IPersonDao extends IpersonDaoSuperInterface<Person> 



    public abstract List<Person> loadAll();


    public abstract Person loadById(Serializable id);


    public abstract List<Person> findByLastName(String lastname);





public interface IpersonDaoSuperInterface<T extends DbObject> 


    public abstract void delete(T entity);


     public abstract Person  persist(Person  entity);


     public abstract T  update(T  entity);




Thanks fore help








View raw message