spring-data-jpa icon indicating copy to clipboard operation
spring-data-jpa copied to clipboard

Allow to add where conditions on subgraphs [DATAJPA-1503]

Open spring-projects-issues opened this issue 6 years ago • 2 comments

Sri Ram opened DATAJPA-1503 and commented


No further details from DATAJPA-1503

spring-projects-issues avatar Feb 01 '19 18:02 spring-projects-issues

Oliver Drotbohm commented

Please elaborate

spring-projects-issues avatar Feb 01 '19 21:02 spring-projects-issues

Sri Ram commented

Person -----> parent entity

Address -----> child entity

Person has one to many relationship with address entity

I'm using @EntityGraph(attributePaths = {"Person", "Person.address"}) to eager fetch the related entities and root entity. I'm unable to specify where condition for related entities for example If I want to filter the address based on a field "AddressType" while using entitygraph, I couldn't able to do that. So I'm trying to figure out if there is a way.

Equivalent SQL:-

select * from Person p join Address a on a.address_id = p.address_id where a.addressType = 'OFFICE';

 

spring-projects-issues avatar Feb 04 '19 14:02 spring-projects-issues