tasfe / generic-dao

Automatically exported from code.google.com/p/generic-dao
0 stars 0 forks source link

Howto deal with several persistence units? #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
EntityManager injected via default persistence unit:

    @PersistenceContext
    public final void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
    }

Howto deal with several persistence units?

Original issue reported on code.google.com by andrey.s...@gmail.com on 21 Aug 2010 at 8:44

GoogleCodeExporter commented 9 years ago
The last commit will help you deal with several persistence units. I removed 
the @PersistenceContext from the GenericDao class. Now, you can use the 
annotation into your own DAO and specify a persistence context name.

The CdiGenericDao contains the @PersistenceContext.

Original comment by simon...@gmail.com on 17 Oct 2010 at 1:51