Skip to content

Commit 34927b7

Browse files
committed
minor edits
1 parent 0f42872 commit 34927b7

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

agrest-docs-protocol/src/docs/asciidoc/_chapters/_05_expressions-syntax.adoc

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
== Expression Syntax
22

33
Expressions passed via an `exp` control parameter or inside a JSON `include` are conditions evaluated in the context of
4-
the root request entity (in the former case), or a nested entity (in the latter case). We've already discussed
4+
the root request entity (in the former case), or a nested entity (in the latter case). We've already shown
55
the URL parameter structure for `exp` (e.g. how to pass parameters). Here we will focus on the syntax of the expression
66
itself.
77

8-
NOTE: The expression syntax presented here is a part of the Agrest protocol. Some Agrest backends may not be able to
9-
support every single expression described here, but most should work with a reasonable subset. And the default Java
10-
server shipped with Agrest (that works on top of relational databases) supports the syntax in its entirety.
8+
NOTE: The syntax presented here is a part of the Agrest protocol. Though some Agrest backends may not be able to
9+
support every single expression described here, but most should work with a reasonable subset. The Java server framework
10+
shipped by the Agrest project supports the syntax in its entirety.
1111

1212
=== Literals
1313

@@ -41,7 +41,7 @@ A variety of number literals are supported - positive / negative, whole / decima
4141
// double
4242
2.1
4343
44-
// big decimal
44+
// big decimal (arbitrary size and precision)
4545
2.1001234065B
4646
4747
// TODO: hex types, etc.
@@ -54,14 +54,14 @@ String literals contain arbitrary sequences of characters, and are enclosed in e
5454
'abc'
5555
"abc"
5656
57-
// if quotes are present in strings, either use non-conflicting quote symbols,
57+
// if quotes are present in a string, either use non-conflicting quote symbols,
5858
// or escape them explicitly
5959
'a"c'
6060
"a'c"
6161
"a\"c"
6262
----
6363

64-
Date / time components are regular quoted strings that follow ISO 8601 format:
64+
Date / time components are just strings that follow ISO 8601 format:
6565
[source]
6666
----
6767
"2023-09-11"
@@ -87,16 +87,23 @@ books
8787
// Dot-separated path spanning multiple entities
8888
books.id
8989
books.library.name
90+
----
91+
92+
NOTE: Paths are used not only in expressions, but also in a variety of other control parameters (`sort`, `include`,
93+
`exclude`, `mapBy`)
94+
95+
There are a few advanced features that allow to specify special behavior of the relationship path components:
9096

91-
// Adding "+" to a relationship name anywhere in the path indicates "optional" semantics.
97+
[source]
98+
----
99+
// "Optional" semantics
100+
101+
// Adding "+" to a relationship anywhere in the path indicates optional" semantics.
92102
// This is a hint to the server evaluating the expression. E.g. if the expression is
93103
// translated to SQL, LEFT JOIN will be used for optional expressions
94104
books+.library.name
95105
----
96106

97-
NOTE: Paths are used not only in expressions, but also in a variety of other control parameters (`sort`, `include`,
98-
`exclude`, `mapBy`)
99-
100107
=== Parameters
101108

102109
Parameters are placeholders in expressions that are replaced with scalar values when the expression is

0 commit comments

Comments
 (0)