Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>because I came from Spring, I believe DAO still has its value, so I decided to add a DAO layer.</p> </blockquote> <p>I don't really see what Spring has to do with this. And I don't agree <a href="https://stackoverflow.com/questions/2100115/i-found-jpa-or-alike-dont-encourage-dao-pattern/2100319#2100319">as I wrote in a previous answer</a>. To me, JPA is a DAL (data access layer), and I don't see the point of putting a data access layer on top of another data access layer. At least not systematically. But let's not discuss this.</p> <blockquote> <p>This is a JPA-implemented DAO , I hope the EE container or the test container able to inject the EntityManager (just like Spring does).</p> </blockquote> <p>If your DAO is a managed component like a CDI managed bean, then the Java EE container should be able to inject an <code>EntityManager</code> in it. </p> <p>For <strong>unit testing</strong> of container-managed objects, you don't need any kind of container. For <strong>integration testing</strong>, you will need some kind of container, just like you do for Spring beans, Hibernate/JPA entities, session beans, CDI managed beans or any other kind of container-managed object. You could <a href="http://www.adam-bien.com/roller/abien/entry/embedding_ejb_3_1_container" rel="nofollow noreferrer">use the EJB3.1 embeddable API in your tests</a>. Also have a look at <a href="http://community.jboss.org/docs/DOC-14376?uniqueTitle=false" rel="nofollow noreferrer">Arquillian</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload