-
May 10th, 2011, 04:38 PM
#1
spring data jpa M2 query findBy did not work for non-id fields
I have a simple application which tries out the spring data jpa M2 release. I have this repository defined:
public interface fooRepository extends JpaRepository<Foo, String> {
// query by ID
List<Foo> findByFooId(String fooId);
List<Foo> findByRating(String rating);
}
the FooId is a @Id field in the domain model, and Rating is a normal field. The first method will always work, but the second one always return 0 rows. Is there anything special about the fields that are not id?
Spring data jpa did simplify a lot of things, if this query works!
-much thanks as always-
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules