diff --git a/documentation/manual/jpa.textile b/documentation/manual/jpa.textile index c550c049fd..396faf6167 100644 --- a/documentation/manual/jpa.textile +++ b/documentation/manual/jpa.textile @@ -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 ==[Property][Comparator]And?== where Comparator can be the following: +Simple queries follow the following syntax ==[Property][Comparator]And?[Orderdirective]?== where Comparator can be the following: * @LessThan@ - less than the given value * @LessThanEquals@ - less than or equal a give value @@ -132,6 +132,11 @@ Simple queries follow the following syntax ==[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: