Hello,

When I have a Company - Employee - Project structure with all eagerly loaded 
@OneToMany relations, selecting companies performs 3 SQL queries independent of 
the number of companies. I changed the mapping from Company to Employee to a 
@ManyToOne or @OneToOne (which you would use for example for a CEO field in 
Company). When I then select Companies, OpenJPA will load the Employee.projects 
list with one SQL query for each Employee that it has found:

openjpa.jdbc.SQLDiag - load field: 'projects' for oid=468 class 
entities.Employee

Is this expected behavior? I see this "load field for oid" happening a lot when 
I eagerly fetch a part of our domain object graph using FetchPlans.

Thanks,
Henno Vermeulen
Huize Molenaar

Reply via email to