Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to compare Lists in JPA

 
Aleks Eustace
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help to create JPA query.
There is Person class with field Address.




And I have input parameter List<Address> requiredAddresses.
I have to find persons having at least one address from list requiredAddresses.



Such request doesnt work.
Please advise right solution.
 
Aleks Eustace
Greenhorn
Posts: 6
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This code was never going to work because the Person class does not have an instance member called addresses, it is called address.
 
Aleks Eustace
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic