Reputation: 11
I want to use orderBy with one properties of my entity class please any one can suggest how to use OrderBy keyword in jpa spring repository because I am not getting this keyword in default keyword list of jpa.
Upvotes: 1
Views: 6991
Reputation: 2970
Use can use orderBy property of Spring Data Jpa.
findByLastnameOrderByFirstnameDesc(String lastName)
will do what you want.
Upvotes: 5
Reputation: 5209
Use OrderBy e.g.
List findByLastnameOrderByFirstnameAsc(String lastname);
Upvotes: 0