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
Post a Comment