Elffuss BraidHub

kikocis/java-driver public

Improvements to object mapper doc.
Changesetd844cea208b1200c5f3878600670c80276c42f29778a2bc9749181201338c4ea
Authorolim7t <omichallat+github@gmail.com> · 2016-01-25 17:15 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-01-26 22:39 +01:00
Parents5366b0f3c217

Browse the files at this changeset

2 files changed

modified manual/custom_codecs/README.md +3 −2
@@ -139,7 +139,6 @@
139139 The second step is to register your codec with a `CodecRegistry` instance:
140140
141141 ```java
142-ObjectMapper objectMapper = ...
143142 JsonCodec<MyPojo> myJsonCodec = new JsonCodec<MyPojo>(MyPojo.class);
144143 CodecRegistry myCodecRegistry = cluster.getConfiguration().getCodecRegistry();
145144 myCodecRegistry.register(myJsonCodec);
@@ -201,6 +200,8 @@
201200 avoid any ambiguity by requiring the user to explicitly specify the desired Java type,
202201 thus forcing the driver to pick the right codec for the right task.
203202
203+Custom codecs also work with the driver's [object mapper](../object_mapper/custom_codecs/).
204+
204205 ### On-the-fly codec generation
205206
206207 `CodecRegistry` instances not only store default codecs and user-defined codecs;
@@ -224,7 +225,7 @@
224225 the need to explicitly declare a codec for this specific CQL type:
225226
226227 ```java
227-JsonCodec<MyPojo> myJsonCodec = new JsonCodec<MyPojo>(MyPojo.class, objectMapper);
228+JsonCodec<MyPojo> myJsonCodec = new JsonCodec<MyPojo>(MyPojo.class);
228229 myCodecRegistry.register(myJsonCodec);
229230 Row row = ...
230231 List<MyPojo> myPojos = row.getList("jsonList", MyPojo.class); // works out of the box!
modified manual/object_mapper/README.md +6 −2
@@ -1,6 +1,6 @@
11 # Object Mapper
22
3-Version 2.1 of the driver introduces a simple object mapper, which
3+The driver provides a simple object mapper, which
44 avoids most of the boilerplate when converting your domain classes to
55 and from query results. It handles basic CRUD operations in Cassandra tables
66 containing UDTs, collections and all native CQL types.
@@ -15,4 +15,8 @@
1515 </dependency>
1616 ```
1717
18-This documentation is organized in subsections describing mapper features.
18+See the child pages for more information:
19+
20+* [definition of mapped classes](creating/)
21+* [using the mapper](using/)
22+* [using custom codecs](custom_codecs/)