I'm in a situation where I need to determine the EntityManager's unit name at run time.
For example, I'd like to do something like this:
@PersistenceContext(unitName = findAppropriateJdbcName())
EntityManager entityManager;
However, this is not possible with annotations.
Is it possible to create the EntityManager when your not sure of what the unit name is until run time?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…