Skip to content

Commit

Permalink
EXPOSED-675 Clarify that sort methods are from the Kotlin std lib in …
Browse files Browse the repository at this point in the history
…DAO's 'CRUD operations'
  • Loading branch information
vnikolova committed Jan 9, 2025
1 parent e7ad4df commit a6a8ef7
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions documentation-website/Writerside/topics/DAO-CRUD-Operations.topic
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,34 @@
include-symbol="users"/>
</chapter>
<chapter title="Sort results" id="sort-by">
<p>
The <code>.all()</code> function returns a <code>SizedIterable</code> that stores all entity instances
associated with the invoking entity class. <code>SizedIterable</code> implements the Kotlin
<code>Iterable</code> interface, which allows calling any sorting methods from the
<a href="https://kotlinlang.org/api/core/kotlin-stdlib/">
Kotlin standard library
</a>
.
</p>
<chapter title="Ascending order" id="sortedBy">
<p>
To sort results in ascending order, use the <code>.sortedBy()</code> function:
To sort results in ascending order, use the
<a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/sorted-by.html">
<code>.sortedBy()</code>
</a>
function:
</p>
<code-block lang="kotlin"
src="exposed-dao/src/main/kotlin/org/example/examples/ReadExamples.kt"
include-symbol="moviesByAscOrder"/>
</chapter>
<chapter title="Descending order" id="sortedByDescending">
<p>
To sort results in descending order, use <code>.sortedByDescending()</code>:
To sort results in descending order, use the
<a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/sorted-by-descending.html">
<code>.sortedByDescending()</code>
</a>
function:
</p>
<code-block lang="kotlin"
src="exposed-dao/src/main/kotlin/org/example/examples/ReadExamples.kt"
Expand Down

0 comments on commit a6a8ef7

Please sign in to comment.