Skip to content

Commit 3895eec

Browse files
Update documentation.
Original Pull Request: #654
1 parent a569a08 commit 3895eec

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/main/antora/modules/ROOT/pages/keyvalue/repository/map-repositories.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,36 @@ It is possible to change the `QueryEngine` and use a custom one instead of the d
2323
The `EnableMapRepositories` annotation allows to configure the by supplying a `QueryEngineFactory` as well as the `QueryCreator` via according attributes.
2424
Please mind that the `QueryEngine` needs to be able to process queries created by the configured `QueryCreator`.
2525

26+
== Storage Backend Configuration
27+
28+
`KeySpaceStore` provides a simple storage facade that can be used along with the `keySpaceStoreRef` attribute of `EnableMapRepositories` to set the bean reference to the actual storage, overriding `mapType` settings.
29+
30+
====
31+
[source,java]
32+
----
33+
@Configuration
34+
@EnableMapRepositories(keySpaceStoreRef = "store") <1>
35+
public class MapDbConfiguration {
36+
37+
@Bean
38+
KeySpaceStore store(DB db) { <1>
39+
40+
return new KeySpaceStore() {
41+
42+
@Override
43+
public Map<Object, Object> getKeySpace(String keyspace) {
44+
return db.hashMap(keyspace, ...
45+
}
46+
47+
@Override
48+
public void clear() {
49+
//
50+
}
51+
52+
};
53+
}
54+
55+
}
56+
----
57+
<1> reference the `KeySpaceStore` by bean name.
58+
====

0 commit comments

Comments
 (0)