Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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表达式使用】
- Host: GitHub
- URL: https://github.com/kaifuny/easy-jpa
- Owner: Kaifuny
- License: mit
- Created: 2016-11-24T05:15:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-25T06:25:45.000Z (over 6 years ago)
- Last Synced: 2024-10-19T08:18:49.558Z (2 months ago)
- Topics: java, jpa, query, spring-data-jpa
- Language: Java
- Homepage:
- Size: 58.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```