kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | e3b23ce2894bf16a02866bf9e8b68c802ab2e5796c1b3639403297c3cd6665be |
|---|---|
| Author | Olivier Michallat <olim7t@users.noreply.github.com> · 2016-02-23 18:18 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-03-31 16:37 +02:00 |
| Parents | 1e93fea50873 |
2 files changed
modified changelog/README.md +1 −0
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | - [improvement] JAVA-1011: Expose PoolingOptions default values. |
| 8 | 8 | - [improvement] JAVA-630: Don't process DOWN events for nodes that have active connections. |
| 9 | 9 | - [improvement] JAVA-851: Improve UUIDs javadoc with regard to user-provided timestamps. |
| 10 | +- [improvement] JAVA-979: Update javadoc for RegularStatement toString() and getQueryString() to indicate that consistency level and other parameters are not maintained in the query string. | |
| 10 | 11 | |
| 11 | 12 | |
| 12 | 13 | ### 3.0.0 |
modified driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java +30 −0
| @@ -41,6 +41,23 @@ | ||
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Returns the query string for this statement. |
| 44 | + * <p/> | |
| 45 | + * It is important to note that the query string is merely | |
| 46 | + * a CQL representation of this statement, but it does | |
| 47 | + * <em>not</em> convey all the information stored in {@link Statement} | |
| 48 | + * objects. | |
| 49 | + * <p/> | |
| 50 | + * For example, {@link Statement} objects carry numerous protocol-level | |
| 51 | + * settings, such as the {@link Statement#getConsistencyLevel() consistency level} to use, | |
| 52 | + * or the {@link Statement#isIdempotent() idempotence flag}, among others. | |
| 53 | + * <em>None of these settings will be included in the resulting query string.</em> | |
| 54 | + * <p/> | |
| 55 | + * Similarly, if values have been set on this statement because | |
| 56 | + * it has bind markers, these values will not appear in the resulting query string. | |
| 57 | + * <p/> | |
| 58 | + * Note: the consistency level was conveyed at CQL level in older versions | |
| 59 | + * of the CQL grammar, but since <a href="https://issues.apache.org/jira/browse/CASSANDRA-4734">CASSANDRA-4734</a> | |
| 60 | + * it is now a protocol-level setting and consequently does not appear in the query string. | |
| 44 | 61 | * |
| 45 | 62 | * @param codecRegistry the codec registry that will be used if the actual |
| 46 | 63 | * implementation needs to serialize Java objects in the |
| @@ -172,6 +189,19 @@ | ||
| 172 | 189 | return hasValues(CodecRegistry.DEFAULT_INSTANCE); |
| 173 | 190 | } |
| 174 | 191 | |
| 192 | + /** | |
| 193 | + * Returns this statement as a CQL query string. | |
| 194 | + * <p/> | |
| 195 | + * It is important to note that the query string is merely | |
| 196 | + * a CQL representation of this statement, but it does | |
| 197 | + * <em>not</em> convey all the information stored in {@link Statement} | |
| 198 | + * objects. | |
| 199 | + * <p/> | |
| 200 | + * See the javadocs of {@link #getQueryString()} for more information. | |
| 201 | + * | |
| 202 | + * @return this statement as a CQL query string. | |
| 203 | + * @see #getQueryString() | |
| 204 | + */ | |
| 175 | 205 | @Override |
| 176 | 206 | public String toString() { |
| 177 | 207 | return getQueryString(); |