mardi 3 novembre 2015

How can I use diffrent persistence unit in my DAO classes depending on maven phase (Install or test)?

Currently I'm working on a Java webapp and we are using two databases: in-Mem database for unit tests and mysql for production. So we have two persistence units in the persistence.xml and we want to get the EntityManager instance depending on the maven build lifcycle phase (test: hsqldb, install: mysql). Is there any way to do that for example by injecting something?

Many thanks

Aucun commentaire:

Enregistrer un commentaire