Skip to content

Commit 4492e1a

Browse files
committed
Polishing.
Add author tags. Reformat code. Add overrides for methods that were introduced in the meantime. See #978. Original pull request: #1108.
1 parent da9fc8f commit 4492e1a

File tree

15 files changed

+45
-19
lines changed

15 files changed

+45
-19
lines changed

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/AnnotatedCassandraConstructorProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public boolean isPrimaryKeyColumn() {
105105
return delegate.isPrimaryKeyColumn();
106106
}
107107

108+
@Override
109+
public boolean isStaticColumn() {
110+
return delegate.isStaticColumn();
111+
}
112+
108113
@Override
109114
@Nullable
110115
public AnnotatedType findAnnotatedType(Class<? extends Annotation> annotationType) {

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/CassandraConstructorProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public boolean isPrimaryKeyColumn() {
9898
return false;
9999
}
100100

101+
@Override
102+
public boolean isStaticColumn() {
103+
return false;
104+
}
105+
101106
@Nullable
102107
@Override
103108
public AnnotatedType findAnnotatedType(Class<? extends Annotation> annotationType) {

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/SchemaFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
*
4747
* @author Mark Paluch
4848
* @author Christoph Strobl
49+
* @author Aleksei Zotov
4950
* @since 3.0
5051
* @see CreateUserTypeSpecification
5152
* @see CreateTableSpecification

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/generator/CreateTableCqlGenerator.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.springframework.data.cassandra.core.cql.generator;
1717

18+
import static org.springframework.data.cassandra.core.cql.PrimaryKeyType.*;
19+
1820
import java.util.ArrayList;
1921
import java.util.List;
2022
import java.util.Map;
@@ -25,14 +27,13 @@
2527
import org.springframework.data.cassandra.core.cql.keyspace.TableSpecification;
2628
import org.springframework.util.StringUtils;
2729

28-
import static org.springframework.data.cassandra.core.cql.PrimaryKeyType.*;
29-
3030
/**
3131
* CQL generator for generating a {@code CREATE TABLE} statement.
3232
*
3333
* @author Matthew T. Adams
3434
* @author Alex Shvid
3535
* @author Mark Paluch
36+
* @author Aleksei Zotov
3637
*/
3738
public class CreateTableCqlGenerator extends TableOptionsCqlGenerator<TableSpecification<CreateTableSpecification>> {
3839

@@ -78,7 +79,7 @@ private void columnsAndOptionsCql(StringBuilder cql) {
7879
List<ColumnSpecification> clusterKeys = new ArrayList<>();
7980
for (ColumnSpecification col : spec().getColumns()) {
8081
if (col.isStatic()) {
81-
col.toCql(cql).append(" static, ");
82+
col.toCql(cql).append(" STATIC, ");
8283
} else {
8384
col.toCql(cql).append(", ");
8485
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/ColumnSpecification.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@
2929
/**
3030
* Object to configure a CQL column specification.
3131
* <p/>
32-
* Use {@link #name(String)} and {@link #type(DataType)} to set the name and type of the column, respectively. To specify
33-
* a clustered {@code PRIMARY KEY} column, use {@link #clustered()} or {@link #clustered(Ordering)}. To specify that the
34-
* {@code PRIMARY KEY} column is or is part of the partition key, use {@link #partitioned()} instead of
32+
* Use {@link #name(String)} and {@link #type(DataType)} to set the name and type of the column, respectively. To
33+
* specify a clustered {@code PRIMARY KEY} column, use {@link #clustered()} or {@link #clustered(Ordering)}. To specify
34+
* that the {@code PRIMARY KEY} column is or is part of the partition key, use {@link #partitioned()} instead of
3535
* {@link #clustered()} or {@link #clustered(Ordering)}. To specify {@code STATIC} column, use {@link #staticColumn()}.
3636
*
3737
* @author Matthew T. Adams
3838
* @author Alex Shvid
3939
* @author Mark Paluch
40+
* @author Aleksei Zotov
4041
*/
4142
public class ColumnSpecification {
4243

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/TableDescriptor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*
2626
* @author Matthew T. Adams
2727
* @author Alex Shvid
28+
* @author Aleksei Zotov
2829
*/
2930
public interface TableDescriptor {
3031

@@ -60,6 +61,8 @@ public interface TableDescriptor {
6061

6162
/**
6263
* Returns an unmodifiable list of static columns.
64+
*
65+
* @since 3.2
6366
*/
6467
List<ColumnSpecification> getStaticColumns();
6568

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/TableSpecification.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
*/
1616
package org.springframework.data.cassandra.core.cql.keyspace;
1717

18+
import static org.springframework.data.cassandra.core.cql.PrimaryKeyType.*;
19+
1820
import java.util.ArrayList;
1921
import java.util.Collections;
2022
import java.util.List;
2123
import java.util.Optional;
2224

23-
import com.datastax.oss.driver.api.core.CqlIdentifier;
24-
import com.datastax.oss.driver.api.core.type.DataType;
25-
2625
import org.springframework.data.cassandra.core.cql.Ordering;
2726
import org.springframework.data.cassandra.core.cql.PrimaryKeyType;
2827
import org.springframework.util.Assert;
2928

30-
import static org.springframework.data.cassandra.core.cql.PrimaryKeyType.*;
29+
import com.datastax.oss.driver.api.core.CqlIdentifier;
30+
import com.datastax.oss.driver.api.core.type.DataType;
3131

3232
/**
3333
* Object to support the configuration of table specifications that have columns. This class can also be used as a
@@ -36,6 +36,7 @@
3636
* @author Matthew T. Adams
3737
* @author Alex Shvid
3838
* @author Mark Paluch
39+
* @author Aleksei Zotov
3940
*/
4041
public class TableSpecification<T> extends TableOptionsSpecification<TableSpecification<T>> implements TableDescriptor {
4142

@@ -355,8 +356,6 @@ public List<ColumnSpecification> getNonKeyColumns() {
355356

356357
/**
357358
* Returns an unmodifiable list of static columns.
358-
*
359-
* @since 3.2
360359
*/
361360
@Override
362361
public List<ColumnSpecification> getStaticColumns() {

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/BasicCassandraPersistentProperty.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
* @author Antoine Toulme
5555
* @author Mark Paluch
5656
* @author John Blum
57+
* @author Aleksei Zotov
5758
*/
5859
public class BasicCassandraPersistentProperty extends AnnotationBasedPersistentProperty<CassandraPersistentProperty>
5960
implements CassandraPersistentProperty, ApplicationContextAware {
@@ -181,6 +182,7 @@ public boolean isPrimaryKeyColumn() {
181182
*/
182183
@Override
183184
public boolean isStaticColumn() {
185+
184186
Column annotation = findAnnotation(Column.class);
185187

186188
return annotation != null && annotation.isStatic();

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/BasicCassandraPersistentTupleProperty.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*
3030
* @author Mark Paluch
3131
* @author Frank Spitulski
32+
* @author Aleksei Zotov
3233
* @since 2.1
3334
* @see Element
3435
*/

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/CachingCassandraPersistentProperty.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* {@link BasicCassandraPersistentProperty} that pre-computes primary key and embedded flags.
2525
*
2626
* @author Mark Paluch
27+
* @author Aleksei Zotov
2728
* @since 3.1.4
2829
*/
2930
public class CachingCassandraPersistentProperty extends BasicCassandraPersistentProperty {

0 commit comments

Comments
 (0)