I am in a situation where I need to determine the name of an EntityManager element at runtime.
For example, I would like to do something like this:
@PersistenceContext(unitName = findAppropriateJdbcName()) EntityManager entityManager;
However, this is not possible with annotations.
Is it possible to create an EntityManager if you are not sure what the name of the element is at runtime?
Brian dicasa
source share