@@ -125,6 +125,12 @@ added here.
125
125
126
126
=== How to build support for a data store
127
127
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
+
128
134
Hibernate OGM supports various data stores by abstracting them
129
135
with `DatastoreProvider` and `GridDialect`. The supported features vary between data stores,
130
136
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
165
171
certain nature, how to map data. Document-oriented data stores encourage
166
172
an entity-as-document pattern where embedded data structures could be
167
173
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
169
175
individual key-value pairs that map the entity within a hash table
170
176
data structure. Hibernate OGM allows multiple dialects per data store
171
177
and users may choose the most appropriate one.
@@ -223,6 +229,9 @@ support. It helps to have a clear picture about that.
223
229
====
224
230
Start with a small feature set to get a feeling for Hibernate OGM.
225
231
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.
226
235
====
227
236
228
237
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.
233
242
234
243
==== Entities
235
244
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
240
251
property identifiers to indicate nesting. That comes handy when working
241
252
with document stores because you can build a document structure based on that details.
242
253
243
254
244
255
==== Associations
245
256
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
249
265
entity itself or externally (as own documents or relation items).
250
266
251
267
268
+
252
269
==== Configuration
253
270
254
271
Hibernate OGM uses a sophisticated configuration mechanism that obtains
255
272
its values from various sources. Most common configuration sources are:
256
273
257
- * hibernate.properties file
258
- * persistence.xml file
274
+ * ` hibernate.properties` file
275
+ * ` persistence.xml` file
259
276
* annotation configuration (entity classes)
260
277
* programmatic configuration
261
278
@@ -274,7 +291,7 @@ data store-specific options such as `ReadPreference` for MongoDB or `TTL` for Re
274
291
275
292
===== Programmatic configuration
276
293
277
- Data store support can implement programmatical configuration. The
294
+ Data store support can implement programmatic configuration. The
278
295
configuration splits into three parts:
279
296
280
297
* Global configuration
@@ -336,4 +353,4 @@ dialect to the `@SkipByGridDialect` annotation of some tests.
336
353
Running even 20% of the tests green is a great achievement. Proceed step-by-step.
337
354
Large numbers of tests can fail just because of one thing that is handled differently.
338
355
Don't hesitate to ask for support.
339
- ====
356
+ ====
0 commit comments