Elffuss BraidHub

kikocis/java-driver public

Fix binary incompatiblity with select().raw().
Changesetc06dc4e78c859110c7555f99924cdd27dbbb604ba8cf547ac295377f525d65e5
Authorolim7t <omichallat+github@gmail.com> · 2015-06-26 19:54 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-06-26 19:54 +02:00
Parentsd3ae2055778c

Browse the files at this changeset

2 files changed

modified driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java +11 −9
@@ -347,14 +347,6 @@
347347 */
348348 public abstract SelectionOrAlias column(String name);
349349
350- /**
351- * Selects the provided raw expression.
352- *
353- * @param rawString the raw expression to add.
354- * @return this in-build SELECT statement
355- */
356- public abstract SelectionOrAlias raw(String rawString);
357-
358350 /**
359351 * Selects the write time of provided column.
360352 * <p>
@@ -478,7 +470,17 @@
478470 return queueName(name);
479471 }
480472
481- @Override
473+ /**
474+ * Selects the provided raw expression.
475+ *
476+ * This method is used internally by the mapper module. It is not exposed on the parent class {@link Selection} to
477+ * avoid breaking binary compatibility. This means that it is not accessible directly via the fluent API (you need
478+ * a cast). This shouldn't be a problem for regular clients because they will use other methods of the DSL
479+ * ({@code fcall}, etc.) rather than provide a raw string.
480+ *
481+ * @param rawString the raw expression to add.
482+ * @return this in-build SELECT statement
483+ */
482484 public SelectionOrAlias raw(String rawString) {
483485 return queueName(QueryBuilder.raw(rawString));
484486 }
modified driver-mapping/src/main/java/com/datastax/driver/mapping/QueryType.java +1 −1
@@ -75,7 +75,7 @@
7575 Select.Selection selection = select();
7676 for (ColumnMapper cm : mapper.allColumns()) {
7777 Select.SelectionOrAlias column = (cm.kind == ColumnMapper.Kind.COMPUTED)
78- ? selection.raw(cm.getColumnName())
78+ ? ((Select.SelectionOrAlias)selection).raw(cm.getColumnName())
7979 : selection.column(cm.getColumnName());
8080
8181 if (cm.getAlias() == null) {