Elffuss BraidHub

kikocis/java-driver public

JAVA-979: Update javadoc for RegularStatement

(cherry picked from 2.1)
Changesete3b23ce2894bf16a02866bf9e8b68c802ab2e5796c1b3639403297c3cd6665be
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2016-02-23 18:18 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-03-31 16:37 +02:00
Parents1e93fea50873

Browse the files at this changeset

2 files changed

modified changelog/README.md +1 −0
@@ -7,6 +7,7 @@
77 - [improvement] JAVA-1011: Expose PoolingOptions default values.
88 - [improvement] JAVA-630: Don't process DOWN events for nodes that have active connections.
99 - [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.
1011
1112
1213 ### 3.0.0
modified driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java +30 −0
@@ -41,6 +41,23 @@
4141
4242 /**
4343 * 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.
4461 *
4562 * @param codecRegistry the codec registry that will be used if the actual
4663 * implementation needs to serialize Java objects in the
@@ -172,6 +189,19 @@
172189 return hasValues(CodecRegistry.DEFAULT_INSTANCE);
173190 }
174191
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+ */
175205 @Override
176206 public String toString() {
177207 return getQueryString();