kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | a3f1b7a590489863a882955b62b9daef4d58c262bd4e070811ecccc1b62949dd |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-22 12:29 +01:00 |
| Committer | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-22 12:29 +01:00 |
| Parents | 732cde7e1c80 |
7 files changed
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/InstantCodec.java +4 −4
| @@ -33,16 +33,16 @@ | ||
| 33 | 33 | import static java.time.temporal.ChronoField.*; |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * <p> | |
| 37 | 36 | * {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp} |
| 38 | 37 | * allowing the setting and retrieval of {@code timestamp} |
| 39 | 38 | * columns as {@link Instant} instances. |
| 40 | - * </p> | |
| 41 | 39 | * <p/> |
| 42 | - * <p> | |
| 43 | 40 | * Since C* <code>timestamp</code> columns do not preserve timezones |
| 44 | 41 | * any attached timezone information will be lost. |
| 45 | - * </p> | |
| 42 | + * <p/> | |
| 43 | + * <strong>IMPORTANT</strong>: this codec's {@link #format(Instant) format} method formats | |
| 44 | + * timestamps using an ISO-8601 format that includes milliseconds. | |
| 45 | + * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong> | |
| 46 | 46 | * |
| 47 | 47 | * @see ZonedDateTimeCodec |
| 48 | 48 | * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a> |
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/jdk8/ZonedDateTimeCodec.java +4 −2
| @@ -34,13 +34,11 @@ | ||
| 34 | 34 | import static java.time.temporal.ChronoField.*; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * <p/> | |
| 38 | 37 | * {@link TypeCodec} that maps |
| 39 | 38 | * {@link ZonedDateTime} to CQL {@code tuple<timestamp,varchar>}, |
| 40 | 39 | * providing a pattern for maintaining timezone information in |
| 41 | 40 | * Cassandra. |
| 42 | 41 | * <p/> |
| 43 | - * <p/> | |
| 44 | 42 | * Since Cassandra's <code>timestamp</code> type preserves only |
| 45 | 43 | * milliseconds since epoch, any timezone information |
| 46 | 44 | * would normally be lost. By using a |
| @@ -48,6 +46,10 @@ | ||
| 48 | 46 | * persisted in the <code>varchar</code> field such that when the |
| 49 | 47 | * value is deserialized the timezone is |
| 50 | 48 | * preserved. |
| 49 | + * <p/> | |
| 50 | + * <strong>IMPORTANT</strong>: this codec's {@link #format(Object) format} method formats | |
| 51 | + * timestamps using an ISO-8601 format that includes milliseconds. | |
| 52 | + * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong> | |
| 51 | 53 | * |
| 52 | 54 | * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a> |
| 53 | 55 | * section of CQL specification. |
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/DateTimeCodec.java +4 −2
| @@ -33,13 +33,11 @@ | ||
| 33 | 33 | import static org.joda.time.DateTimeZone.UTC; |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * <p/> | |
| 37 | 36 | * {@link TypeCodec} that maps |
| 38 | 37 | * {@link DateTime} to CQL {@code tuple<timestamp,varchar>}, |
| 39 | 38 | * providing a pattern for maintaining timezone information in |
| 40 | 39 | * Cassandra. |
| 41 | 40 | * <p/> |
| 42 | - * <p/> | |
| 43 | 41 | * Since Cassandra's <code>timestamp</code> type preserves only |
| 44 | 42 | * milliseconds since epoch, any timezone information |
| 45 | 43 | * would normally be lost. By using a |
| @@ -47,6 +45,10 @@ | ||
| 47 | 45 | * persisted in the <code>varchar</code> field such that when the |
| 48 | 46 | * value is deserialized the timezone is |
| 49 | 47 | * preserved. |
| 48 | + * <p/> | |
| 49 | + * <strong>IMPORTANT</strong>: this codec's {@link #format(Object) format} method formats | |
| 50 | + * timestamps using an ISO-8601 format that includes nanoseconds. | |
| 51 | + * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong> | |
| 50 | 52 | * |
| 51 | 53 | * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a> |
| 52 | 54 | * section of CQL specification. |
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/InstantCodec.java +10 −1
| @@ -31,7 +31,16 @@ | ||
| 31 | 31 | import static java.lang.Long.parseLong; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp}. | |
| 34 | + * {@link TypeCodec} that maps {@link Instant} to CQL {@code timestamp} | |
| 35 | + * allowing the setting and retrieval of {@code timestamp} | |
| 36 | + * columns as {@link Instant} instances. | |
| 37 | + * <p/> | |
| 38 | + * Since C* <code>timestamp</code> columns do not preserve timezones | |
| 39 | + * any attached timezone information will be lost. | |
| 40 | + * <p/> | |
| 41 | + * <strong>IMPORTANT</strong>: this codec's {@link #format(Instant) format} method formats | |
| 42 | + * timestamps using an ISO-8601 format that includes milliseconds. | |
| 43 | + * <strong>This format is incompatible with Cassandra versions < 2.0.9.</strong> | |
| 35 | 44 | * |
| 36 | 45 | * @see DateTimeCodec |
| 37 | 46 | * @see <a href="https://cassandra.apache.org/doc/cql3/CQL-2.2.html#usingtimestamps">Working with timestamps</a> |
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/joda/LocalTimeCodec.java +1 −2
| @@ -33,8 +33,7 @@ | ||
| 33 | 33 | /** |
| 34 | 34 | * {@link TypeCodec} that maps {@link LocalTime} to CQL {@code time} (long representing nanoseconds since midnight). |
| 35 | 35 | * <p/> |
| 36 | - * <p/> | |
| 37 | - * IMPORTANT: {@link LocalTime} has millisecond precision; nanoseconds below one millisecond will be lost | |
| 36 | + * <strong>IMPORTANT</strong>: {@link LocalTime} has millisecond precision; nanoseconds below one millisecond will be lost | |
| 38 | 37 | * during deserialization. |
| 39 | 38 | */ |
| 40 | 39 | public class LocalTimeCodec extends TypeCodec<LocalTime> { |
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/JacksonJsonCodec.java +0 −2
| @@ -33,12 +33,10 @@ | ||
| 33 | 33 | * A JSON codec that uses the <a href="http://wiki.fasterxml.com/JacksonHome">Jackson</a> |
| 34 | 34 | * library to perform serialization and deserialization of JSON objects. |
| 35 | 35 | * <p/> |
| 36 | - * <p/> | |
| 37 | 36 | * This codec maps a single Java object to a single JSON structure at a time; |
| 38 | 37 | * mapping of arrays or collections to root-level JSON arrays is not supported, |
| 39 | 38 | * but such a codec can be easily crafted after this one. |
| 40 | 39 | * <p/> |
| 41 | - * <p/> | |
| 42 | 40 | * Note that this codec requires the presence of Jackson library at runtime. |
| 43 | 41 | * If you use Maven, this can be done by declaring the following dependency in your project: |
| 44 | 42 | * <p/> |
modified driver-extras/src/main/java/com/datastax/driver/extras/codecs/json/Jsr353JsonCodec.java +1 −5
| @@ -40,13 +40,12 @@ | ||
| 40 | 40 | * users should manually downcast to either {@link JsonObject} or {@link JsonArray}, |
| 41 | 41 | * as in the example below: |
| 42 | 42 | * <pre>{@code |
| 43 | - * <p/> | |
| 44 | 43 | * // setting values |
| 45 | 44 | * JsonObject myObject = ... |
| 46 | 45 | * PreparedStatement ps = ... |
| 47 | 46 | * // set values using JsonStructure as target Java type |
| 48 | 47 | * BoundStatement bs = ps.bind().set(1, myObject, JsonStructure.class); |
| 49 | - * <p/> | |
| 48 | + * | |
| 50 | 49 | * // retrieving values |
| 51 | 50 | * Row row = session.execute(bs).one(); |
| 52 | 51 | * // use JsonStructure as target Java type to retrieve values |
| @@ -56,13 +55,10 @@ | ||
| 56 | 55 | * ... |
| 57 | 56 | * } |
| 58 | 57 | * }</pre> |
| 59 | - * <p/> | |
| 60 | - * <p/> | |
| 61 | 58 | * Note that at runtime, this codec requires the presence of both JSR-353 API |
| 62 | 59 | * and a JSR-353-compatible runtime library, such as |
| 63 | 60 | * <a href="https://jsonp.java.net/download.html">JSR-353's reference implementation</a>. |
| 64 | 61 | * If you use Maven, this can be done by declaring the following dependencies in your project: |
| 65 | - * <p/> | |
| 66 | 62 | * <pre>{@code |
| 67 | 63 | * <dependency> |
| 68 | 64 | * <groupId>javax.json</groupId> |