kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | a542c0877cae23dfd781aa3896f57d6790f08a92e5009c33b54252235b433faa |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-07-06 10:08 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-07-06 10:08 +02:00 |
| Parents | bbf28cf9e115 |
4 files changed
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationChecks.java +2 −2
| @@ -103,8 +103,8 @@ | ||
| 103 | 103 | |
| 104 | 104 | static void checkValidComputed(Field field) { |
| 105 | 105 | 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())); | |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java +1 −1
| @@ -233,7 +233,7 @@ | ||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | if (computedField != null) { |
| 236 | - return computedField.formula(); | |
| 236 | + return computedField.value(); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return field.getName().toLowerCase(); |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/Computed.java +1 −1
| @@ -46,5 +46,5 @@ | ||
| 46 | 46 | * |
| 47 | 47 | * @return the formula. |
| 48 | 48 | */ |
| 49 | - String formula(); | |
| 49 | + String value(); | |
| 50 | 50 | } |
modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperComputedFieldsTest.java +2 −2
| @@ -162,10 +162,10 @@ | ||
| 162 | 162 | |
| 163 | 163 | // quotes in the column name inserted on purpose |
| 164 | 164 | // to test the alias generation mechanism |
| 165 | - @Computed(formula = "writetime(\"name\")") | |
| 165 | + @Computed(value = "writetime(\"name\")") | |
| 166 | 166 | long writeTime; |
| 167 | 167 | |
| 168 | - @Computed(formula = "ttl(name)") | |
| 168 | + @Computed("ttl(name)") | |
| 169 | 169 | Integer ttl; |
| 170 | 170 | |
| 171 | 171 | public String getLogin() { |