From d04e5aaf4329640088cb9754321e05a3cae0665e Mon Sep 17 00:00:00 2001 From: Hao Wen Date: Wed, 12 Oct 2016 09:47:01 +0800 Subject: [PATCH] [Wen Hao] - update README. --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ee16720..40917f4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ # jpa-spec +### Features + +* Compatible with JPA 2 interface. +* Equal/NotEqual/Like support multiple values, Equal/NotEqual support **Null** value. +* Builder style specification creator. + + +### JPA 2 criteria API introduction + JPA 2 introduces a criteria API that can be used to build queries programmatically. Writing a criteria you actually define the where-clause of a query for a domain class. @@ -32,7 +41,7 @@ repositories { } dependencies { - compile 'com.github.wenhao:jpa-spec:2.0.6' + compile 'com.github.wenhao:jpa-spec:2.0.7' } ``` @@ -44,7 +53,7 @@ add repository [http://jcenter.bintray.com](http://jcenter.bintray.com) to maven com.github.wenhao jpa-spec - 2.0.6 + 2.0.7 ``` @@ -76,7 +85,7 @@ Specification specification = new Specifications() .like("nickName", "%og", "%me") .build(); -personRepository.findAll(specification, new PageRequest(0, 15)); +Page persons = personRepository.findAll(specification, new PageRequest(0, 15)); ``` ####Equal/NotEqual Example @@ -107,7 +116,7 @@ Specification specification = new Specifications() .gt(Objects.nonNull(person.getAge()), "age", 18) .build(); -personRepository.findAll(specification, new PageRequest(0, 15)); +Page persons = personRepository.findAll(specification, new PageRequest(0, 15)); ``` ####Between Example @@ -139,5 +148,6 @@ Specification specification = new Specifications() Sort sort = new Sort(new Order(DESC, "name"), new Order(ASC, "birthday")); -personRepository.findAll(specification, new PageRequest(0, 15, sort)); +Page persons = personRepository.findAll(specification, new PageRequest(0, 15, sort)); +long totalCount = personRepository.count(specification); ```