Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 772fd61

Browse files
OGM-916 Dialect guide: clarify association logic and other minor improvements
1 parent d6e02c0 commit 772fd61

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

documentation/manual/src/main/asciidoc/en-US/modules/how-to-contribute.asciidoc

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ added here.
125125

126126
=== How to build support for a data store
127127

128+
[TIP]
129+
.Advanced section
130+
====
131+
This is an advanced subject, feel free to skip this section if you are not building a data store.
132+
====
133+
128134
Hibernate OGM supports various data stores by abstracting them
129135
with `DatastoreProvider` and `GridDialect`. The supported features vary between data stores,
130136
and dialects do not have to implement all features. Hibernate OGM implements a TCK
@@ -165,7 +171,7 @@ how data is mapped to a particular data store. NoSQL data stores imply a
165171
certain nature, how to map data. Document-oriented data stores encourage
166172
an entity-as-document pattern where embedded data structures could be
167173
stored within the document itself. Key-value data stores allow different
168-
approaches, e. g. storing an entity as JSON document or event storing
174+
approaches, e.g. storing an entity as JSON document or event storing
169175
individual key-value pairs that map the entity within a hash table
170176
data structure. Hibernate OGM allows multiple dialects per data store
171177
and users may choose the most appropriate one.
@@ -223,6 +229,9 @@ support. It helps to have a clear picture about that.
223229
====
224230
Start with a small feature set to get a feeling for Hibernate OGM.
225231
You can always extend the features as you proceed.
232+
233+
Starting from or studying existing dialects is also an interesting strategy.
234+
It can be intimidating with complex dialects though.
226235
====
227236

228237
Hibernate OGM is not opinionated by which means data is stored/loaded
@@ -233,29 +242,37 @@ of that database by sticking to established patterns and idioms of that store.
233242

234243
==== Entities
235244

236-
Entities are seen by a dialect as `Tuple`. A `Tuple` may contain a
237-
snapshot (that`s the persistent view of the data), a set of
238-
key-value pairs that carry the actual data, and a list of operations
239-
to apply onto the original snapshot. Tuple keys use dot-path
245+
Entities are seen by a dialect as `Tuple`. A `Tuple` contains:
246+
247+
* a snapshot (that's the view of the data as loaded from your database),
248+
* a set of key-value pairs that carry the actual data,
249+
* and a list of operations to apply onto the original snapshot.
250+
Tuple keys use dot-path
240251
property identifiers to indicate nesting. That comes handy when working
241252
with document stores because you can build a document structure based on that details.
242253

243254

244255
==== Associations
245256

246-
The least NoSQL data stores have built-in support for associations
247-
between entities (unless you're using a graph database). Associations
248-
are kind of artificial. Association data can be stored within the
257+
Most NoSQL data stores have no built-in support for associations
258+
between entities (unless you're using a graph database).
259+
260+
Hibernate OGM simulates associations for datastore with no support
261+
by storing the navigational information to go from a given entity
262+
to its (list of) associated entity.
263+
This of it as query materialisation.
264+
This navigational information data can be stored within the
249265
entity itself or externally (as own documents or relation items).
250266

251267

268+
252269
==== Configuration
253270

254271
Hibernate OGM uses a sophisticated configuration mechanism that obtains
255272
its values from various sources. Most common configuration sources are:
256273

257-
* hibernate.properties file
258-
* persistence.xml file
274+
* `hibernate.properties` file
275+
* `persistence.xml` file
259276
* annotation configuration (entity classes)
260277
* programmatic configuration
261278

@@ -274,7 +291,7 @@ data store-specific options such as `ReadPreference` for MongoDB or `TTL` for Re
274291

275292
===== Programmatic configuration
276293

277-
Data store support can implement programmatical configuration. The
294+
Data store support can implement programmatic configuration. The
278295
configuration splits into three parts:
279296

280297
* Global configuration
@@ -336,4 +353,4 @@ dialect to the `@SkipByGridDialect` annotation of some tests.
336353
Running even 20% of the tests green is a great achievement. Proceed step-by-step.
337354
Large numbers of tests can fail just because of one thing that is handled differently.
338355
Don't hesitate to ask for support.
339-
====
356+
====

0 commit comments

Comments
 (0)