You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DATAREDIS-425 - Normalize index paths for maps and lists.
Remove map key and list index values for secondary index structures. Paths like 'map.[key].property' are normalized to map.key.property. Same applies for lists 'list.[index].property' is converted to 'list.property'.
To allow better control over index resolution the entire logic has been moved to IndexResolver now inspecting the whole type instead of single properties.
Copy file name to clipboardExpand all lines: src/asciidoc/reference/redis-repositories.adoc
+48-14Lines changed: 48 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ public void basicCrudOperations() {
89
89
repo.delete(rand); <4>
90
90
}
91
91
----
92
-
<1> Generates a new id if current values is `null` or reuses an already set id value and stores properties of type `Person` inside the Redis Hash with key with pattern `keyspace:id` in this case eg. `persons:5d67b7e1-8640-4475-beeb-c666fab4c0e5`.
92
+
<1> Generates a new id if current value is `null` or reuses an already set id value and stores properties of type `Person` inside the Redis Hash with key with pattern `keyspace:id` in this case eg. `persons:5d67b7e1-8640-4475-beeb-c666fab4c0e5`.
93
93
<2> Uses the provided id to retrieve the object stored at `keyspace:id`.
94
94
<3> Counts the total number of entities available within the keyspace _persons_ defined by `@RedisHash` on `Person`.
95
95
<4> Removes the key for the given object from Redis.
NOTE: Indexes will not be resolved on <<redis.repositories.references,References>>.
215
+
194
216
Same as with _keyspaces_ it is possible to configure indexes without the need of annotating the actual domain type.
195
217
196
218
.Index Setup via @EnableRedisRepositories
@@ -260,7 +282,7 @@ NOTE: The keyspace notification message listener will alter `notify-keyspace-eve
260
282
261
283
[[redis.repositories.mapping]]
262
284
== Object to hash mapping
263
-
The Redis Repository support persists Objects in Hashes. This requires an Object to Hash conversion which is done by a `RedisConverter`. The default implementation uses `Converter`s for mapping property values to and from Redis native `byte[]`.
285
+
The Redis Repository support persists Objects in Hashes. This requires an Object to Hash conversion which is done by a `RedisConverter`. The default implementation uses `Converter` for mapping property values to and from Redis native `byte[]`.
264
286
265
287
Given the `Person` type from the previous sections the default mapping looks like the following:
Mapping behavior can be customized by registering the according `Converter`s in `CustomConversions`. Those Converters can take care of converting from/to a single `byte[]` as well as `Map<Sting,byte[]>` whereas the first one is suiteable for eg. converting one complex type to eg. a binary JSON representation that still uses the default mappings hash structure, whereas the second options offers full control over the resulting hash.
<1> Reference stores the whole key (`keyspace:id`) of the referenced object.
421
454
====
422
455
423
456
424
-
WARNING: Referenced Objects are not subject of persisting changes when saving the referencing object. Please make sure to persist changes on referenced objects separately, since only the reference will be stored.
457
+
WARNING: Referenced Objects are not subject of persisting changes when saving the referencing object. Please make sure to persist changes on referenced objects separately, since only the reference will be stored.
458
+
Indexes set on properties of referenced types will not be resolved.
0 commit comments