Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kaifuny/easy-jpa

Java Persistence on Query By Example 【Lambda表达式使用】
https://github.com/kaifuny/easy-jpa

java jpa query spring-data-jpa

Last synced: 18 days ago
JSON representation

Java Persistence on Query By Example 【Lambda表达式使用】

Awesome Lists containing this project

README

        

# easy-jpa
Java Persistence API(JPA) on Query By Example(QBE)
**Base on Spring Data JPA**

# Version
**0.0.1**

## Next Version
* distinct support
* math support

# Features
* Support and/or logic operation
* Support is(Empty/Boolean/Null)
* Support Equal/NotEqual/In/NotIn/Like/NotLike
* Support gt/ge/lt/le/between
* Support group by
* Support custom specification.
* Support pagination

**more features coming soon**

# Java Version
```
jdk build 1.8 or later
```

# How to Use
```java
@Resource
UserReponsitory userReponsitory;

/*
SQL:
select * from
user
where
id=1
or id=2
group by
id,
name
order by
id asc,
name asc
limit ?
*/
public List findAll(){
Example example = ExampleBuilder.create();
example.or()
.andEqual("id", 1)
.orEqual("id", 2);
example.groupBy("id","name");
example.asc("id","name");
return userReponsitory.findAll(example, new PageRequest(0, 1));
}
```

# How to Dev
* Test
```
mvn test
```

* Package
```
mvn clean
mvn package
```