kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | d844cea208b1200c5f3878600670c80276c42f29778a2bc9749181201338c4ea |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2016-01-25 17:15 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-01-26 22:39 +01:00 |
| Parents | 5366b0f3c217 |
2 files changed
modified manual/custom_codecs/README.md +3 −2
| @@ -139,7 +139,6 @@ | ||
| 139 | 139 | The second step is to register your codec with a `CodecRegistry` instance: |
| 140 | 140 | |
| 141 | 141 | ```java |
| 142 | -ObjectMapper objectMapper = ... | |
| 143 | 142 | JsonCodec<MyPojo> myJsonCodec = new JsonCodec<MyPojo>(MyPojo.class); |
| 144 | 143 | CodecRegistry myCodecRegistry = cluster.getConfiguration().getCodecRegistry(); |
| 145 | 144 | myCodecRegistry.register(myJsonCodec); |
| @@ -201,6 +200,8 @@ | ||
| 201 | 200 | avoid any ambiguity by requiring the user to explicitly specify the desired Java type, |
| 202 | 201 | thus forcing the driver to pick the right codec for the right task. |
| 203 | 202 | |
| 203 | +Custom codecs also work with the driver's [object mapper](../object_mapper/custom_codecs/). | |
| 204 | + | |
| 204 | 205 | ### On-the-fly codec generation |
| 205 | 206 | |
| 206 | 207 | `CodecRegistry` instances not only store default codecs and user-defined codecs; |
| @@ -224,7 +225,7 @@ | ||
| 224 | 225 | the need to explicitly declare a codec for this specific CQL type: |
| 225 | 226 | |
| 226 | 227 | ```java |
| 227 | -JsonCodec<MyPojo> myJsonCodec = new JsonCodec<MyPojo>(MyPojo.class, objectMapper); | |
| 228 | +JsonCodec<MyPojo> myJsonCodec = new JsonCodec<MyPojo>(MyPojo.class); | |
| 228 | 229 | myCodecRegistry.register(myJsonCodec); |
| 229 | 230 | Row row = ... |
| 230 | 231 | 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 @@ | ||
| 1 | 1 | # Object Mapper |
| 2 | 2 | |
| 3 | -Version 2.1 of the driver introduces a simple object mapper, which | |
| 3 | +The driver provides a simple object mapper, which | |
| 4 | 4 | avoids most of the boilerplate when converting your domain classes to |
| 5 | 5 | and from query results. It handles basic CRUD operations in Cassandra tables |
| 6 | 6 | containing UDTs, collections and all native CQL types. |
| @@ -15,4 +15,8 @@ | ||
| 15 | 15 | </dependency> |
| 16 | 16 | ``` |
| 17 | 17 | |
| 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/) |