Skip to content

SimpleJpaRepository.findAllById doesn't join eager fetched columns [DATAJPA-1721] #2016

Open
@spring-projects-issues

Description

@spring-projects-issues

cda opened DATAJPA-1721 and commented

Using SimpleJpaRepository.findById(ID is) results in a query with left outer joins for each eager relationship.

Using SimpleJpaRepository.findAllById(Iterable ids) results in a query that fetches current entity columns and additional select queries for each eager relationship.

The performance of findAllById is affected by the additional select queries. Ideally it should generate the same query as findById but with id in () instead of id = .

 
SimpleJpaRepository.findAllById(Iterable ids) is generating a JPQL query to fetch entities and reading Vlad Mihalcea article it seems that using JPQL to fetch entities uses a different fetching strategy than entitymanager.find that results in additional selects


No further details from DATAJPA-1721

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions