Elffuss BraidHub

kikocis/java-driver public

JAVA-979: Update javadoc for RegularStatement toString() and getQueryString() to indicate that consistency level and other parameters are not maintained in the query string.
Changeset77eb4157e3b96b75409803eb06af026a72efcf967f2b9462376a35f4ee5e30cf
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2016-02-17 16:22 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-02-23 18:18 +01:00
Parentsba8004b7aec6

Browse the files at this changeset

3 files changed

modified changelog/README.md +1 −0
@@ -15,6 +15,7 @@
1515 - [improvement] JAVA-1011: Expose PoolingOptions default values.
1616 - [improvement] JAVA-630: Don't process DOWN events for nodes that have active connections.
1717 - [improvement] JAVA-851: Improve UUIDs javadoc with regard to user-provided timestamps.
18+- [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.
1819
1920 Merged from 2.0 branch:
2021
modified driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java +30 −0
@@ -35,6 +35,23 @@
3535
3636 /**
3737 * Returns the query string for this statement.
38+ * <p/>
39+ * It is important to note that the query string is merely
40+ * a CQL representation of this statement, but it does
41+ * <em>not</em> convey all the information stored in {@link Statement}
42+ * objects.
43+ * <p/>
44+ * For example, {@link Statement} objects carry numerous protocol-level
45+ * settings, such as the {@link Statement#getConsistencyLevel() consistency level} to use,
46+ * or the {@link Statement#isIdempotent() idempotence flag}, among others.
47+ * <em>None of these settings will be included in the resulting query string.</em>
48+ * <p/>
49+ * Similarly, if values have been set on this statement because
50+ * it has bind markers, these values will not appear in the resulting query string.
51+ * <p/>
52+ * Note: the consistency level was conveyed at CQL level in older versions
53+ * of the CQL grammar, but since <a href="https://issues.apache.org/jira/browse/CASSANDRA-4734">CASSANDRA-4734</a>
54+ * it is now a protocol-level setting and consequently does not appear in the query string.
3855 *
3956 * @return a valid CQL query string.
4057 */
@@ -88,6 +105,19 @@
88105 */
89106 public abstract boolean hasValues();
90107
108+ /**
109+ * Returns this statement as a CQL query string.
110+ * <p/>
111+ * It is important to note that the query string is merely
112+ * a CQL representation of this statement, but it does
113+ * <em>not</em> convey all the information stored in {@link Statement}
114+ * objects.
115+ * <p/>
116+ * See the javadocs of {@link #getQueryString()} for more information.
117+ *
118+ * @return this statement as a CQL query string.
119+ * @see #getQueryString()
120+ */
91121 @Override
92122 public String toString() {
93123 return getQueryString();
modified driver-core/src/main/java/com/datastax/driver/core/SimpleStatement.java +0 −5
@@ -102,11 +102,6 @@
102102 return serializedValues;
103103 }
104104
105- /**
106- * Returns the query string.
107- *
108- * @return the query string;
109- */
110105 @Override
111106 public String getQueryString() {
112107 return query;