I am using Spring Data JPA.
I an entity like this
public class A {
@CollectionTable(name = \"B_ITEMS\", joinColumns = @JoinColumn(name = \"B_ID\"))
Instead of using @Query like in @Zeromus answer you can also define it by method name (findByElementCollectionProperty_NestedProperty):
public interface ARepo extends JPARepository {
List findByBs_Prop1(String prop1);
}
More information how SpringData resolves nested Properties can be found under:
Query Property Expressions