I'm struggling to find any type of documentation on how to query more complex attributes in my models.
For example I have
public class MyEmbedded{
@EmbeddedID
private MyEmbeddedPK embeddedPK;
}
@Embeddable
public class MyEmbeddedPK{
private Integer age;
private Integer zip;
}
In my repository I am implementing the CrudRepository and would expect to be able to do
public List<MyEmbedded> findByageAndZip(String age, String zip);
But that doesn't seem to work. The documentation doesn't really say anything regarding @EmbeddedId's. The same goes for querying a @OneToMany attribute, I never found anything for that.
Documentation I am referencing. http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repository-query-keywords
Is there any better documentation on how this query creation works?