cancel
Showing results for 
Search instead for 
Did you mean: 

JPA: Eager Fetch via (Outer) Join supported?

Former Member
0 Kudos

Hi,

in EclipseLink and Hibernate Associations with FetchType.EAGER can be configured, so that the objects are pulled out of the database with a single (outer) join statement.

Example (EclipseLink)

InsurancePolicy has many Coverages.

@OneToMany(fetch=FetchType.EAGER, mappedBy="policy")

@JoinFetch(value=JoinFetchType.OUTER)

private List<Coverage> coverages;

Now, if I load a policy, its coverages are pulled together witht the policy with an outer join out of the datatbase.

How is this handled in the SAP JPA?

Thanks

Jan

Accepted Solutions (1)

Accepted Solutions (1)

adrian_goerler
Employee
Employee
0 Kudos

Hi Jan,

sorry for the late reply. SAP handles this as follows:

if you load a Policy, the related Coverage entities will be loaded with an additional query. If you execute a query loading multiple Policies, SAP JPA will load all Coverage entities related to all Policies en-bloc by a single additional query.

This behaviour is not configurable.

-Adrian

Answers (0)