This probably is of no help to solve the problem, but you may like to know that this kind of problems is being discussed for the implementation of JPA 2.1
This sounds like one of those cases of multitenancy:
Proposal for Multitenancy Support in JPA 2.1 JSR-338