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: docs/query_specs.adoc
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -308,13 +308,13 @@ Generated SQL:
308
308
+
309
309
NOTE: The `distinct` keyword is being used in the queries to eliminate duplicates in case of `one-to-many` and `many-to-many` joins.
310
310
311
-
TIP: Sometimes the join capabilities is not enough or the not best way for the use case you trying to implement,
311
+
TIP: Sometimes the join capabilities is not enough or not the best way for the use case you trying to implement,
312
312
in such case you can create a database _view_ and map it to an JPA Entity and then build your search on it.
313
313
314
314
TIP: The returned properties are the properties of the primary Entity, which means the `projection` is not supported due to limitation in spring-data-jpa addressed in this https://github.com/mhewedy/spring-data-jpa-mongodb-expressions/issues/4[bug,role=external,window=_blank], until it is fixed and if you need to return properties from other entities involved in the join, you need to follow the database _view_ workaround mentioned in the previous tip.
315
315
316
316
==== Left and right joins
317
-
1. Left join uses notation `.<` and right join uses `.>`, exmaple on left join:
317
+
1. Left join uses notation `.<` and right join uses `.>`, example on left join (department left join city):
318
318
+
319
319
[source,json]
320
320
----
@@ -324,12 +324,12 @@ Generated SQL:
324
324
+
325
325
[source,sql]
326
326
----
327
-
...from employee e left join department d on d.id=e.department_id join city c on c.id=d.city_id where e.first_name=? or c.name=?
327
+
...from employee e join department d on d.id = e.department_id left join city c on c.id = d.city_id where e.first_name = ? or c.name = ?
328
328
----
329
329
+
330
330
NOTE: The join notation that define the relation between an object and its association so,
331
-
`department.<city.name` means left join between `employee` (current object) and `department`,
332
-
where `department.city.<name` means left join between `departement` and `city`
331
+
`"<department.city.name"` means left join between `employee` (current object) and `department`,
332
+
where `"department.<city.name"` means left join between `departement` and `city`
0 commit comments