From 16eb9bbf3783380717b39541398c0824109cd495 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 15 Jul 2021 10:16:14 +0200 Subject: [PATCH] [Minor] cleanup formatting --- content/documentation/queries.md | 2 +- content/documentation/realms.md | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/content/documentation/queries.md b/content/documentation/queries.md index 7743a4e..39ca894 100644 --- a/content/documentation/queries.md +++ b/content/documentation/queries.md @@ -5,7 +5,7 @@ weight: 89 ## Queries {{% notice warning %}} -The Query API is deprecated and the search API should be used instead. +The Query API is deprecated and the [search API](/documentation/searches) should be used instead. {{% /notice %}} As is custom for every framework, querying the model must be possible. Strolch diff --git a/content/documentation/realms.md b/content/documentation/realms.md index 854f09f..23f9266 100644 --- a/content/documentation/realms.md +++ b/content/documentation/realms.md @@ -28,8 +28,8 @@ however need to configure the realms for their specific project. If the project only requires one realm, then the `defaultRealm` can be used, where the developer only is required to configure the mode and any relevant model file. -If the mode is `CACHED`, then the `PersistenceHandler` component is required to be -configured, so that the DAOs know how to access the underlying database. +If the mode is `CACHED`, then the `PersistenceHandler` component is required to +be configured, so that the DAOs know how to access the underlying database. The configuration in the `StrolchConfiguration.xml` file is as follows: @@ -45,7 +45,8 @@ The configuration in the `StrolchConfiguration.xml` file is as follows: - EMPTY|TRANSIENT|CACHED + + TRANSIENT StrolchModel.xml @@ -109,10 +110,13 @@ Opening a transaction is done from a `Service` by calling one of the `openTx()`-methods. Nevertheless, the realm can be accessed as follows: ```java -ComponentContainer container = getAgent().getContainer(); -StrolchRealm realm = container.getRealm(StrolchConstants.DEFAULT_REALM); -try(StrolchTransaction tx = realm.openTx()) { - Resource resource = tx.getResourceBy("TestType", "MyTestResource"); - ... +public class Example { + public static void main(String[] args) { + ComponentContainer container = getAgent().getContainer(); + StrolchRealm realm = container.getRealm(StrolchConstants.DEFAULT_REALM); + try (StrolchTransaction tx = realm.openTx()) { + Resource resource = tx.getResourceBy("TestType", "MyTestResource"); + } + } } ```