openjpa - JPA: load a related entity from another persistence context? -


i have entity called route, has related entity called employee:

public class route {     @manytoone     private employee driver;      // more fields... }  public class employee {      // more fields... } 

these 2 entities stored in different databases. so, live in 2 different persistence contexts. because of that, when load route entity, "driver" field null.

is possible load route , automatically fetch "driver" field somehow?

no, it's not possible. how jpa execute such basic query?

select r route r r.driver.name = :name 

you'll have store id of driver in route entity, load explicitely, , hope it's there (because don't have foreign key constraint).


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -