I have one jar library A (or project in eclipse), which has it s own persistence unit (META-INF/persistence.xml) and some entity classes, and another project (B) using this one. In project B there is also persistence unit and entity classes.
In project B I need to use both entity classes from project A and B. But if I set "A" as persistence unit name, EntityManager cannot create named query if this query is in entity from project B. If I set "B" as persistence unit name, it cannot create named queries from entities from project A. Error message is:
NamedQuery of name: MyEntityName.myQueryName not found.
Can persistence units somehow include other persistence units? Or is there any other way to solve this problem?