You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Query.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Why #
2
2
3
-
I use DataTables in some projects and wrote SpringMVC server side for it. Later the frontend is rewritten and DataTables is no longer used. Now is the time to refine the protocol for general data-grid query.
3
+
I use DataTables in some projects and wrote SpringMVC server side for it. Later the frontend is rewritten and DataTables is no longer used. Now is the time to refine the protocol for general data-grid query.
4
4
5
5
* You can not assign a range via `columns[i][search][value]`, as in SQL: `BETWEEN`.
6
6
* You can only do regular search OR regex search via `columns[i][search][regex]`, but not `=`, `LIKE`.
@@ -34,7 +34,8 @@ HTTP POST as `@RequestBody` is recommended:
34
34
"_like": "",
35
35
"_exists": true,
36
36
"_isNull": true,
37
-
"_isEmpty": true
37
+
"_isEmpty": true,
38
+
"_isvlid": true
38
39
}
39
40
}
40
41
}
@@ -56,7 +57,7 @@ e.g. NO parameters are needed.
56
57
57
58
### Pagination ###
58
59
59
-
Paging is controlled by `offset` and `limit`, which keeps the same as `SKIP` and `LIMIT` in SQL.
60
+
Paging is controlled by `offset` and `limit`, which keeps the same as `SKIP` and `LIMIT` in SQL.
Copy file name to clipboardExpand all lines: eaphone-spring-data-query-samples/README.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,25 @@ This is a simple Spring Boot project using [biggates/eaphone-spring-data-query](
4
4
5
5
The original sample project is [darrachequesne/spring-data-jpa-datatables-sample](https://github.com/darrachequesne/spring-data-jpa-datatables-sample).
6
6
7
-
## How to run ##
7
+
## How to run
8
8
9
9
(Not verified)
10
10
11
-
```
11
+
```bash
12
12
mvn spring-boot:run
13
13
```
14
14
15
15
The project will start at `http://localhost:8080/`.
16
16
17
-
## What is this? ##
17
+
## What is this?
18
18
19
19
This project shows how to use eaphone-spring-data-query in your project, and a very basic version of JavaScript grid.
20
20
21
21
The web page contains three parts: request (and examples), raw response and rendered grid.
22
22
23
23

24
24
25
-
## Features ##
25
+
## Features
26
26
27
27
The page contains one data grid, with some pre-defined searching values.
28
28
@@ -33,37 +33,37 @@ On the page you can try the following features:
33
33
* Change order by any single column
34
34
* Pagination
35
35
36
-
## Some details ##
36
+
## Some details
37
37
38
38
* During the starting process, it inserts `200` completely random rows of `Order` item in `OrderRestController#insertSampleData()`, plus 2 specific `Order` item, in order to provide at least one search result in pre-defined queries.
39
-
* The project serves a static web page, displaying a grid using DataTables. The detailed initialization script is in `/index.js`.
39
+
* The project serves a static web page, displaying a grid using DataTables. The detailed initialization script is in `/index.js`.
40
40
41
-
### jpa ###
41
+
### jpa
42
42
43
43
* An [H2](http://www.h2database.com/html/main.html) in-memory database is created.
44
44
45
-
### mongodb ###
45
+
### mongodb
46
46
47
47
* This project uses [bwaldvogel/mongo-java-server](https://github.com/bwaldvogel/mongo-java-server) to create an in-memory MongoDB server named `test` (see `MongodbSampleApplication$Config`).
48
48
49
-
* The params `startDate` and `endDate` is used to restrict the range of a value. DataTables only handles "match" type of search, which is usually not enough. The criteria and `preFiltering` is used to further define a criteria.
49
+
* The params `startDate` and `endDate` is used to restrict the range of a value. DataTables only handles "match" type of search, which is usually not enough. The criteria and `preFiltering` is used to further define a criteria.
50
50
51
-
## Usage in your project ##
51
+
## Usage in your project
52
52
53
53
If you want to use `eaphone-spring-data-query` in your own project, these steps must be done:
54
54
55
55
1. Include the library in your project (it's not in any public Maven repository yet)
56
56
2. Declare a spring-data repo, extending `JpaQueryRepository<EntityType, KeyType>` or `MongoDBQueryRepository<DocumentType, KeyType>`
57
-
3. Create your controller, basically as:
57
+
3. Create your controller, basically as:
58
58
59
-
```
60
-
@Autowired
61
-
private OrderRepo repo;
59
+
```java
60
+
@Autowired
61
+
privateOrderRepo repo;
62
62
63
-
@GetMapping()
64
-
public QueryOutput<Order> getOrders(@Valid QueryInput input){
0 commit comments