kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | e35903a94cbb0c2081da31aa92742b2354c3d78ae474a66e04e8d83b4d6d6c30 |
|---|---|
| Author | Olivier Michallat <olim7t@users.noreply.github.com> · 2016-02-23 18:18 +01:00 |
| Committer | Olivier Michallat <olim7t@users.noreply.github.com> · 2016-02-23 18:18 +01:00 |
| Parents | ba8004b7aec6, 77eb4157e3b9 |
3 files changed
modified changelog/README.md +1 −0
| @@ -15,6 +15,7 @@ | ||
| 15 | 15 | - [improvement] JAVA-1011: Expose PoolingOptions default values. |
| 16 | 16 | - [improvement] JAVA-630: Don't process DOWN events for nodes that have active connections. |
| 17 | 17 | - [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. | |
| 18 | 19 | |
| 19 | 20 | Merged from 2.0 branch: |
| 20 | 21 |
modified driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java +30 −0
| @@ -35,6 +35,23 @@ | ||
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * 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. | |
| 38 | 55 | * |
| 39 | 56 | * @return a valid CQL query string. |
| 40 | 57 | */ |
| @@ -88,6 +105,19 @@ | ||
| 88 | 105 | */ |
| 89 | 106 | public abstract boolean hasValues(); |
| 90 | 107 | |
| 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 | + */ | |
| 91 | 121 | @Override |
| 92 | 122 | public String toString() { |
| 93 | 123 | return getQueryString(); |
modified driver-core/src/main/java/com/datastax/driver/core/SimpleStatement.java +0 −5
| @@ -102,11 +102,6 @@ | ||
| 102 | 102 | return serializedValues; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - /** | |
| 106 | - * Returns the query string. | |
| 107 | - * | |
| 108 | - * @return the query string; | |
| 109 | - */ | |
| 110 | 105 | @Override |
| 111 | 106 | public String getQueryString() { |
| 112 | 107 | return query; |