From 4a1b5fa543787cfea043ae72ff60af673b1c7558 Mon Sep 17 00:00:00 2001 From: Matthew Adams Date: Thu, 12 Dec 2013 11:18:06 -0600 Subject: [PATCH] renamed partition() -> partitioned(), primary() -> clustered() as appropriate --- .../generator/CreateTableCqlGenerator.java | 10 +++---- .../core/keyspace/ColumnSpecification.java | 26 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/CreateTableCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/CreateTableCqlGenerator.java index 655a5f559..c13d456ab 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/CreateTableCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/CreateTableCqlGenerator.java @@ -65,14 +65,14 @@ public class CreateTableCqlGenerator extends TableCqlGenerator partitionKeys = new ArrayList(); - List clusteredKeys = new ArrayList(); + List clusterKeys = new ArrayList(); for (ColumnSpecification col : spec().getColumns()) { col.toCql(cql).append(", "); if (col.getKeyType() == PARTITIONED) { partitionKeys.add(col); } else if (col.getKeyType() == CLUSTERED) { - clusteredKeys.add(col); + clusterKeys.add(col); } } @@ -91,11 +91,11 @@ public class CreateTableCqlGenerator extends TableCqlGenerator options = spec().getOptions(); diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnSpecification.java index db4d78c16..d232a612a 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnSpecification.java @@ -31,9 +31,9 @@ import com.datastax.driver.core.DataType; * Builder class to help construct CQL statements that involve column manipulation. Not threadsafe. *

* Use {@link #name(String)} and {@link #type(String)} to set the name and type of the column, respectively. To specify - * a PRIMARY KEY column, use {@link #primary()} or {@link #primary(Ordering)}. To specify that the - * PRIMARY KEY column is or is part of the partition key, use {@link #partition()} instead of - * {@link #primary()} or {@link #primary(Ordering)}. + * a PRIMARY KEY column, use {@link #clustered()} or {@link #clustered(Ordering)}. To specify that the + * PRIMARY KEY column is or is part of the partition key, use {@link #partitioned()} instead of + * {@link #clustered()} or {@link #clustered(Ordering)}. * * @author Matthew T. Adams * @author Alex Shvid @@ -77,8 +77,8 @@ public class ColumnSpecification { * * @return this */ - public ColumnSpecification partition() { - return partition(true); + public ColumnSpecification partitioned() { + return partitioned(true); } /** @@ -88,20 +88,20 @@ public class ColumnSpecification { * * @return this */ - public ColumnSpecification partition(boolean partition) { - this.keyType = partition ? PARTITIONED : null; + public ColumnSpecification partitioned(boolean partitioned) { + this.keyType = partitioned ? PARTITIONED : null; this.ordering = null; return this; } /** - * Identifies this column as a primary key column with default ordering. Sets the column's {@link #keyType} to + * Identifies this column as a clustered key column with default ordering. Sets the column's {@link #keyType} to * {@link PrimaryKeyType#CLUSTERED} and its {@link #ordering} to {@link #DEFAULT_ORDERING}. * * @return this */ - public ColumnSpecification primary() { - return primary(DEFAULT_ORDERING); + public ColumnSpecification clustered() { + return clustered(DEFAULT_ORDERING); } /** @@ -110,8 +110,8 @@ public class ColumnSpecification { * * @return this */ - public ColumnSpecification primary(Ordering order) { - return primary(order, true); + public ColumnSpecification clustered(Ordering order) { + return clustered(order, true); } /** @@ -121,7 +121,7 @@ public class ColumnSpecification { * * @return this */ - public ColumnSpecification primary(Ordering order, boolean primary) { + public ColumnSpecification clustered(Ordering order, boolean primary) { this.keyType = primary ? CLUSTERED : null; this.ordering = primary ? order : null; return this;