Elffuss BraidHub

kikocis/java-driver public

Change Computed annotation to use default attribute name.
Changeseta542c0877cae23dfd781aa3896f57d6790f08a92e5009c33b54252235b433faa
Authorolim7t <omichallat+github@gmail.com> · 2015-07-06 10:08 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-07-06 10:08 +02:00
Parentsbbf28cf9e115

Browse the files at this changeset

4 files changed

modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java +2 −2
@@ -103,8 +103,8 @@
103103
104104 static void checkValidComputed(Field field) {
105105 Computed computed = field.getAnnotation(Computed.class);
106- if (computed != null && computed.formula().isEmpty()){
107- throw new IllegalArgumentException(String.format("Field %s: attribute 'formula' of annotation @Computed is mandatory for computed fields", field.getName()));
106+ if (computed != null && computed.value().isEmpty()){
107+ throw new IllegalArgumentException(String.format("Field %s: attribute 'value' of annotation @Computed is mandatory for computed fields", field.getName()));
108108 }
109109 }
110110
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java +1 −1
@@ -233,7 +233,7 @@
233233 }
234234
235235 if (computedField != null) {
236- return computedField.formula();
236+ return computedField.value();
237237 }
238238
239239 return field.getName().toLowerCase();
modified driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Computed.java +1 −1
@@ -46,5 +46,5 @@
4646 *
4747 * @return the formula.
4848 */
49- String formula();
49+ String value();
5050 }
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java +2 −2
@@ -162,10 +162,10 @@
162162
163163 // quotes in the column name inserted on purpose
164164 // to test the alias generation mechanism
165- @Computed(formula = "writetime(\"name\")")
165+ @Computed(value = "writetime(\"name\")")
166166 long writeTime;
167167
168- @Computed(formula = "ttl(name)")
168+ @Computed("ttl(name)")
169169 Integer ttl;
170170
171171 public String getLogin() {