kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 37e876ef1735c4552f632e583dec051d4c5180a84709ea8b8df5563370891ee8 |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2016-07-12 11:26 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-07-22 09:47 -07:00 |
| Parents | a7a8be09fd1a |
1 file changed
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java +9 −6
| @@ -22,7 +22,6 @@ | ||
| 22 | 22 | import com.datastax.driver.core.UserType; |
| 23 | 23 | import com.datastax.driver.mapping.MethodMapper.ParamMapper; |
| 24 | 24 | import com.datastax.driver.mapping.annotations.*; |
| 25 | -import com.google.common.annotations.VisibleForTesting; | |
| 26 | 25 | import com.google.common.base.Strings; |
| 27 | 26 | import com.google.common.collect.ImmutableSet; |
| 28 | 27 | import com.google.common.reflect.TypeToken; |
| @@ -44,8 +43,10 @@ | ||
| 44 | 43 | @SuppressWarnings({"unchecked", "WeakerAccess"}) |
| 45 | 44 | class AnnotationParser { |
| 46 | 45 | |
| 47 | - @VisibleForTesting | |
| 48 | - static final Set<Class<? extends Annotation>> VALID_PROPERTY_ANNOTATIONS = ImmutableSet.of( | |
| 46 | + /** | |
| 47 | + * Annotations allowed on a property that maps to a table column. | |
| 48 | + */ | |
| 49 | + private static final Set<Class<? extends Annotation>> VALID_COLUMN_ANNOTATIONS = ImmutableSet.of( | |
| 49 | 50 | Column.class, |
| 50 | 51 | Computed.class, |
| 51 | 52 | ClusteringColumn.class, |
| @@ -55,8 +56,10 @@ | ||
| 55 | 56 | PartitionKey.class, |
| 56 | 57 | Transient.class); |
| 57 | 58 | |
| 58 | - @VisibleForTesting | |
| 59 | - static final Set<Class<? extends Annotation>> VALID_FIELD_ANNOTATIONS = ImmutableSet.of( | |
| 59 | + /** | |
| 60 | + * Annotations allowed on a property that maps to a UDT field. | |
| 61 | + */ | |
| 62 | + private static final Set<Class<? extends Annotation>> VALID_FIELD_ANNOTATIONS = ImmutableSet.of( | |
| 60 | 63 | Field.class, |
| 61 | 64 | Frozen.class, |
| 62 | 65 | FrozenKey.class, |
| @@ -119,7 +122,7 @@ | ||
| 119 | 122 | if (mappingManager.isCassandraV1 && propertyMapper.isComputed()) |
| 120 | 123 | throw new UnsupportedOperationException("Computed properties are not supported with native protocol v1"); |
| 121 | 124 | |
| 122 | - AnnotationChecks.validateAnnotations(propertyMapper, VALID_PROPERTY_ANNOTATIONS); | |
| 125 | + AnnotationChecks.validateAnnotations(propertyMapper, VALID_COLUMN_ANNOTATIONS); | |
| 123 | 126 | |
| 124 | 127 | if (propertyMapper.isTransient()) |
| 125 | 128 | continue; |