Skip to content

Commit

Permalink
[#878] Add OrderBy support in simplified queries : fixes documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
loicdescotte authored and mbknor committed Mar 14, 2012
1 parent 4e233ae commit 1e76061
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions documentation/manual/jpa.textile
Expand Up @@ -115,10 +115,10 @@ bc. Post.find("byTitle", "My first post").fetch();
Post.find("byTitleLike", "%hello%").fetch();
Post.find("byAuthorIsNull").fetch();
Post.find("byTitleLikeAndAuthor", "%hello%", connectedUser).fetch();
Post.find("byTitleOrderByTitle", "%hello%").fetch(); //default for order is asc
Post.find("byTitleOrderByNbCommentsDesc", "%hello%").fetch();
Post.find("byTitleOrderByTitle", "A nice post").fetch();
Post.find("byTitleOrderByNbCommentsDesc", "A nice post").fetch();

Simple queries follow the following syntax <code>==[Property][Comparator]And?==</code> where Comparator can be the following:
Simple queries follow the following syntax <code>==[Property][Comparator]And?[Orderdirective]?==</code> where Comparator can be the following:

* @LessThan@ - less than the given value
* @LessThanEquals@ - less than or equal a give value
Expand All @@ -132,6 +132,11 @@ Simple queries follow the following syntax <code>==[Property][Comparator]And?==<
* @IsNotNull@ - Not a null value (doesn't require an argument)
* @IsNull@ - Is a null value (doesn't require an argument)

and Orderdirective can be (for a property named @property@) :

* @OrderByProperty@ - default ascending order
* @OrderByPropertyDesc@ - descending order

h3. Find using a JPQL query

You can use a JPQL query:
Expand Down

0 comments on commit 1e76061

Please sign in to comment.