Version 1

    I found that we can develop Java EE6 using EJB 3.1 works in conjunction with JPA 2.0 and use SwitchYard's binding to expose as services. CDI will be used to do Dependencies Injection or even EJB's annotations. The project's structure will probably looks like this

     

    Capture.PNG

     

    In order to inject the Entity Manager, I only need to use @PersistenceContext annotation as usual. Nothing is strange here! But we can use EJB's annotations to marked our beans as EJB in order to use the transaction management.

    Capture.PNG

    Capture.PNG