Skip to content

Commit da69b72

Browse files
committed
Added a few more docs for the Query DSL
1 parent f4362b5 commit da69b72

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

docs/framework/orm/query-dsl.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,30 @@ This method orders the results by the given field and returns them in descending
6565
Repo.get(User.class).orderBy("age", true) // All users starting with the oldest descending to the youngest
6666
```
6767

68+
#### groupBy
69+
This method groups the results by the given column name.
70+
```java
71+
Repo.get(User.class).groupBy("age") // Groups all users with the same age together.
72+
```
73+
6874
#### limit
6975
Limit the amount of entities returned.
7076
```java
7177
Repo.get(User.class).limit(3) // Only the first 3 users
7278
```
7379

80+
#### offset
81+
Shifts the entries by n, useful in combination with limit.
82+
```java
83+
Repo.get(User.class).offset(1337) // Starts at the 1337th User
84+
```
85+
86+
#### limit & offset together
87+
The functionality of limit and offset together.
88+
```java
89+
Repo.get(User.class).limit(1337, 100)
90+
```
91+
7492
#### withDeleted
7593
If [soft-deletes](/framework/orm/soft-deletes/) are enabled for the model, this will include soft-deleted entities into the query.
7694
```java

0 commit comments

Comments
 (0)