diff --git a/spring-data-cassandra-distribution/pom.xml b/spring-data-cassandra-distribution/pom.xml
index 9a9015516..554cad069 100644
--- a/spring-data-cassandra-distribution/pom.xml
+++ b/spring-data-cassandra-distribution/pom.xml
@@ -3,13 +3,6 @@
4.0.0
- spring-data-cassandra-distribution
-
- pom
-
- Spring Data for Apache Cassandra - Distribution
- Distribution build for Spring Data for Apache Cassandra
-
org.springframework.data
spring-data-cassandra-parent
@@ -17,6 +10,13 @@
../pom.xml
+ spring-data-cassandra-distribution
+ pom
+
+ Spring Data for Apache Cassandra - Distribution
+ Distribution build for Spring Data for Apache Cassandra
+ https://github.com/spring-projects/spring-data-cassandra/tree/master/spring-data-cassandra-distribution
+
${basedir}/..
SDCASS
diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentEntity.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentEntity.java
index cc26f77f0..20824c84c 100644
--- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentEntity.java
+++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentEntity.java
@@ -20,6 +20,8 @@ import static org.springframework.cassandra.core.cql.CqlIdentifier.*;
import java.util.ArrayList;
import java.util.List;
+import com.datastax.driver.core.UserType;
+
import org.springframework.beans.BeansException;
import org.springframework.cassandra.core.cql.CqlIdentifier;
import org.springframework.cassandra.support.exception.UnsupportedCassandraOperationException;
@@ -38,8 +40,6 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
-import com.datastax.driver.core.UserType;
-
/**
* Cassandra specific {@link BasicPersistentEntity} implementation that adds Cassandra specific metadata.
*
@@ -67,7 +67,7 @@ public class BasicCassandraPersistentEntity extends BasicPersistentEntity typeInformation) {
- this(typeInformation, null);
+ this(typeInformation, null, DEFAULT_VERIFIER);
}
/**
@@ -100,8 +100,8 @@ public class BasicCassandraPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity
* Remember, if the Cassandra table has multiple primary key columns, then you must define a class annotated with
* {@link PrimaryKeyClass} to represent the primary key!
- *
+ *
* @author Alex Shvid
* @author Matthew T. Adams
*/
@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE })
+@Target(value = { ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD })
@Id
public @interface PrimaryKey {
diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/PrimaryKeyColumn.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/PrimaryKeyColumn.java
index 034eca1a5..718b20f0c 100644
--- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/PrimaryKeyColumn.java
+++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/mapping/PrimaryKeyColumn.java
@@ -1,12 +1,12 @@
/*
* Copyright 2013-2014 the original author or authors
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,12 +27,12 @@ import org.springframework.core.annotation.AliasFor;
/**
* Identifies the annotated field of a composite primary key class as a primary key field that is either a partition or
* cluster key field.
- *
+ *
* @author Matthew T. Adams
* @author Mark Paluch
*/
@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE })
+@Target(value = { ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD })
public @interface PrimaryKeyColumn {
/**
diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/Query.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/Query.java
index 95ef6781e..48e0f69a3 100644
--- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/Query.java
+++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/Query.java
@@ -1,12 +1,12 @@
/*
* Copyright 2013-2014 the original author or authors
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,13 +25,13 @@ import org.springframework.data.annotation.QueryAnnotation;
/**
* Annotation to declare finder queries directly on repository methods.
- *
+ *
* @author Alex Shvid
* @author Matthew T. Adams
* @author Mark Paluch
*/
@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
+@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD })
@Documented
@QueryAnnotation
public @interface Query {
@@ -39,7 +39,7 @@ public @interface Query {
/**
* A Cassandra CQL3 string to define the actual query to be executed. Placeholders {@code ?0}, {@code ?1}, etc are
* supported.
- *
+ *
* @return
*/
String value() default "";
diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/CassandraParameters.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/CassandraParameters.java
index 91b15e941..a7da9ae6a 100644
--- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/CassandraParameters.java
+++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/CassandraParameters.java
@@ -85,11 +85,11 @@ public class CassandraParameters extends Parameters T getAnnotation(Class annotationClass) {
return methodParameter.getParameterAnnotation(annotationClass);
}
- /* (non-Javadoc)
- * @see java.lang.reflect.AnnotatedElement#getAnnotations()
+ /**
+ * @inheritDoc
*/
@Override
public Annotation[] getAnnotations() {
return methodParameter.getParameterAnnotations();
}
- /* (non-Javadoc)
- * @see java.lang.reflect.AnnotatedElement#getDeclaredAnnotations()
+ /**
+ * @inheritDoc
*/
@Override
public Annotation[] getDeclaredAnnotations() {
diff --git a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentPropertyUnitTests.java b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentPropertyUnitTests.java
index 2e4d8de65..5b1c82b4a 100755
--- a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentPropertyUnitTests.java
+++ b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/mapping/BasicCassandraPersistentPropertyUnitTests.java
@@ -22,14 +22,14 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Field;
import java.util.Date;
+import com.datastax.driver.core.DataType.Name;
+
import org.junit.Test;
import org.springframework.cassandra.core.cql.CqlIdentifier;
import org.springframework.core.annotation.AliasFor;
import org.springframework.data.util.ClassTypeInformation;
import org.springframework.util.ReflectionUtils;
-import com.datastax.driver.core.DataType.Name;
-
/**
* Unit tests for {@link BasicCassandraPersistentProperty}.
*
@@ -62,20 +62,10 @@ public class BasicCassandraPersistentPropertyUnitTests {
@Test
public void shouldConsiderComposedColumnAnnotation() {
- CassandraPersistentProperty persistentProperty = getPropertyFor(TypeWithComposedColumnAnnotation.class, "column");
- assertThat(persistentProperty.getColumnName()).isEqualTo(CqlIdentifier.cqlId("mycolumn", true));
- }
+ CassandraPersistentProperty persistentProperty =
+ getPropertyFor(TypeWithComposedColumnAnnotation.class, "column");
- /**
- * @see DATACASS-259
- */
- @Test
- public void shouldConsiderComposedPrimaryKeyColumnAnnotation() {
-
- CassandraPersistentProperty persistentProperty = getPropertyFor(TypeWithComposedPrimaryKeyColumnAnnotation.class,
- "column");
assertThat(persistentProperty.getColumnName()).isEqualTo(CqlIdentifier.cqlId("mycolumn", true));
- assertThat(persistentProperty.isPrimaryKeyColumn()).isTrue();
}
/**
@@ -84,20 +74,34 @@ public class BasicCassandraPersistentPropertyUnitTests {
@Test
public void shouldConsiderComposedPrimaryKeyAnnotation() {
- CassandraPersistentProperty persistentProperty = getPropertyFor(TypeWithComposedPrimaryKeyAnnotation.class,
- "column");
+ CassandraPersistentProperty persistentProperty =
+ getPropertyFor(TypeWithComposedPrimaryKeyAnnotation.class, "column");
+
assertThat(persistentProperty.getColumnName()).isEqualTo(CqlIdentifier.cqlId("primary-key", true));
assertThat(persistentProperty.isIdProperty()).isTrue();
}
+ /**
+ * @see DATACASS-259
+ */
+ @Test
+ public void shouldConsiderComposedPrimaryKeyColumnAnnotation() {
+
+ CassandraPersistentProperty persistentProperty =
+ getPropertyFor(TypeWithComposedPrimaryKeyColumnAnnotation.class, "column");
+
+ assertThat(persistentProperty.getColumnName()).isEqualTo(CqlIdentifier.cqlId("mycolumn", true));
+ assertThat(persistentProperty.isPrimaryKeyColumn()).isTrue();
+ }
+
/**
* @see DATACASS-259
*/
@Test
public void shouldConsiderComposedCassandraTypeAnnotation() {
- CassandraPersistentProperty persistentProperty = getPropertyFor(TypeWithComposedCassandraTypeAnnotation.class,
- "column");
+ CassandraPersistentProperty persistentProperty =
+ getPropertyFor(TypeWithComposedCassandraTypeAnnotation.class, "column");
assertThat(persistentProperty.getDataType().getName()).isEqualTo(Name.COUNTER);
assertThat(persistentProperty.findAnnotation(CassandraType.class)).isNotNull();
@@ -131,6 +135,14 @@ public class BasicCassandraPersistentPropertyUnitTests {
String value();
}
+ @Retention(RetentionPolicy.RUNTIME)
+ @PrimaryKey(forceQuote = true)
+ @interface ComposedPrimaryKeyAnnotation {
+
+ @AliasFor(annotation = PrimaryKey.class)
+ String value() default "primary-key";
+ }
+
@Retention(RetentionPolicy.RUNTIME)
@PrimaryKeyColumn(forceQuote = true)
@interface ComposedPrimaryKeyColumnAnnotation {
@@ -142,14 +154,6 @@ public class BasicCassandraPersistentPropertyUnitTests {
int ordinal() default 42;
}
- @Retention(RetentionPolicy.RUNTIME)
- @PrimaryKey(forceQuote = true)
- @interface ComposedPrimaryKeyAnnotation {
-
- @AliasFor(annotation = PrimaryKey.class)
- String value() default "primary-key";
- }
-
@Retention(RetentionPolicy.RUNTIME)
@CassandraType(type = Name.COUNTER)
@interface ComposedCassandraTypeAnnotation {
@@ -159,14 +163,14 @@ public class BasicCassandraPersistentPropertyUnitTests {
@ComposedColumnAnnotation("mycolumn") String column;
}
- static class TypeWithComposedPrimaryKeyColumnAnnotation {
- @ComposedPrimaryKeyColumnAnnotation("mycolumn") String column;
- }
-
static class TypeWithComposedPrimaryKeyAnnotation {
@ComposedPrimaryKeyAnnotation String column;
}
+ static class TypeWithComposedPrimaryKeyColumnAnnotation {
+ @ComposedPrimaryKeyColumnAnnotation("mycolumn") String column;
+ }
+
static class TypeWithComposedCassandraTypeAnnotation {
@ComposedCassandraTypeAnnotation String column;
}