Skip to content

Commit

Permalink
fix: formatting of functions, properties, and interface naming
Browse files Browse the repository at this point in the history
  • Loading branch information
vnikolova committed Dec 19, 2024
1 parent f9b370c commit fd8cfb7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
<p>
Suppose that you want to sort cities by the number of users in each city. To achieve this, you can write a
subquery which counts the users in each city and
then order the result by that count.To do so, however, you need to convert the
then order the result by that count. To do so, however, you need to convert the
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-query/index.html">
<code>Query</code>
</a>
Expand Down
4 changes: 2 additions & 2 deletions documentation-website/Writerside/topics/DAO-Table-Types.topic
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@

<chapter title="Composite id table" id="composite-id-table">
<p>
To define multiple columns as part of the primary key and id, use
To define multiple columns as part of the primary key and ID, use
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.dao.id/-composite-id-table/index.html">
<code>CompositeIdTable</code>
</a>
and mark each composite column using
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-table/entity-id.html">
<code>.entityId()</code>
</a>
. Each component column will be available for CRUD operations either individually (as for any standard column)
.Each component column will be available for CRUD operations either individually (as for any standard column)
or all together as part of the <code>id</code> column:
</p>
<tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@
src="exposed-dsl/src/main/kotlin/org/example/examples/ReadExamples.kt"
include-lines="99-100"/>
<p>
<code>Query</code> inherits <code>Iterable</code> so it is possible to traverse it using <code>map()</code>
or <code>forEach()</code>:
<code>Query</code> inherits <code>Iterable</code> so it is possible to traverse it using <code>.map()</code>
or <code>.forEach()</code>:
</p>
<code-block lang="kotlin"
src="exposed-dsl/src/main/kotlin/org/example/examples/ReadExamples.kt"
Expand Down Expand Up @@ -293,15 +293,15 @@
include-lines="14-24"
/>
<p>
If none of the optional arguments are provided to <code>.upsert()</code>, and an <code>.onUpdate()</code> block
If none of the optional arguments are provided to <code>.upsert()</code>, and an <code>onUpdate</code> block
is omitted, the statements in the <code>body</code> block will be used for both the insert and update parts
of the operation.
This means that, for example, if a table mapping has columns with default values and these columns are
omitted from the <code>body</code> block, the default values will be
used for insertion as well as for the update operation.
</p>
<note>
If the update operation should differ from the insert operation, then <code>onUpdate()</code> should be
If the update operation should differ from the insert operation, then <code>onUpdate</code> should be
provided an argument to set the specific columns to update, as seen in the example below.
<p>
If the update operation involves functions that should use the values that would have been inserted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
src="exposed-dsl/src/main/kotlin/org/example/examples/JoinExamples.kt"
include-lines="39-42"/>
<p>
This is equivalent to using a <code>join()</code> with a <code>JoinType.INNER</code>:
This is equivalent to using a <code>.join()</code> with a <code>JoinType.INNER</code>:
</p>
<code-block lang="kotlin"
src="exposed-dsl/src/main/kotlin/org/example/examples/JoinExamples.kt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-query/group-by.html">
<code>.groupBy()</code>
</a>
, define fields and their functions by the <code>select()</code>
, define fields and their functions by the <code>.select()</code>
method.
</p>
<code-block lang="kotlin"
Expand Down
3 changes: 2 additions & 1 deletion documentation-website/Writerside/topics/SQL-Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ In SQL representation it will be `SQRT(FooTable.id)`
val replacedName = CustomFunction<String?>("REPLACE", VarCharColumnType(), FooTable.name, stringParam("foo"), stringParam("bar"))

```
`CustomFunction` class accepts a function name as a first parameter and the resulting column type as second. After that, you can provide any amount of parameters separated by a comma.
The [`CustomFunction`](https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-custom-function/index.html)
class accepts a function name as a first parameter and the resulting column type as second. After that, you can provide any amount of parameters separated by a comma.

There are also shortcuts for string, long, and datetime functions:
* [`CustomStringFunction`](https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-custom-string-function.html)
Expand Down
6 changes: 3 additions & 3 deletions documentation-website/Writerside/topics/Transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ interface that allows you to implement your own logic before and after these spe
`registerInterceptor()` and `unregisterInterceptor()` can be used to enable and disable a custom interceptor in a single
transaction.

To use a custom interceptor that acts on all transactions, extend the
To use a custom interceptor that acts on all transactions, implement the
[`GlobalStatementInterceptor`](https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql.statements/-global-statement-interceptor/index.html)
class instead. Exposed uses the Java SPI ServiceLoader to discover and load any implementations of this class. In this
situation, a new file should be created in the *resources* folder named:
interface instead. Exposed uses the Java SPI ServiceLoader to discover and load any implementations of this interface.
In this situation, a new file should be created in the *resources* folder named:
```
META-INF/services/org.jetbrains.exposed.sql.statements.GlobalStatementInterceptor
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@
<list>
<li>
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-table/default.html">
<code>default(defaultValue: T)</code>
<code>.default(defaultValue: T)</code>
</a>
accepts a value with a type of the column.
</li>
<li>
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-table/default-expression.html">
<code>defaultExpression(defaultValue: Expression&lt;T&gt;)</code>
<code>.defaultExpression(defaultValue: Expression&lt;T&gt;)</code>
</a>
accepts an expression.
</li>
<li>
<a href="https://jetbrains.github.io/Exposed/api/exposed-core/org.jetbrains.exposed.sql/-table/client-default.html">
<code>clientDefault(defaultValue: () -&gt; T)</code>
<code>.clientDefault(defaultValue: () -&gt; T)</code>
</a>
accepts a function.
</li>
Expand Down

0 comments on commit fd8cfb7

Please sign in to comment.