In the attached zipped example I have declared a finder:
public interface PersonRepository extends PagingAndSortingRepository<Person, String> {
List<Person> findByLastName( String lastName );
}
This causes template instantiation to fail with the below:
Caused by: java.lang.IllegalArgumentException: No property last found for type interface org.acme.Person
at org.springframework.data.repository.query.parser.P roperty.<init>(Property.java:66)
at org.springframework.data.repository.query.parser.P roperty.<init>(Property.java:100)
at org.springframework.data.repository.query.parser.P roperty.create(Property.java:300)
at org.springframework.data.repository.query.parser.P roperty.create(Property.java:314)
at org.springframework.data.repository.query.parser.P roperty.create(Property.java:280)
at org.springframework.data.repository.query.parser.P roperty.from(Property.java:239)
at org.springframework.data.repository.query.parser.P roperty.from(Property.java:227)
at org.springframework.data.repository.query.parser.P art.<init>(Part.java:48)
at org.springframework.data.repository.query.parser.P artTree$OrPart.<init>(PartTree.java:242)
at org.springframework.data.repository.query.parser.P artTree.buildTree(PartTree.java:101)
at org.springframework.data.repository.query.parser.P artTree.<init>(PartTree.java:77)
at org.springframework.data.document.mongodb.reposito ry.PartTreeMongoQuery.<init>(PartTreeMongoQuery.ja va:42)
...
Debugging it appears when Spring MongoDB attempts to "bind" using reflection it uses reflectionUtils.findField() which will calls Class.getDeclaredFields(). Put another way it just looks at fields and does not look at getters and setters which is all the interface has. Could it be changed to be able to bing to getters/setters, or alternatively bind later when it gets the concrete class?
Last question - any target release date for DATADOC-131 ?
Commented on the ticket. In short: that's exactly what the ticket is all about. The ticket is scheduled for 1.1-M1. As we're just on the road to 1.0-RC1 and GA so it will probably take a while.