From d2313980c1f485204470f9bc6f8f736cdfb9436d Mon Sep 17 00:00:00 2001 From: Alex Shvid Date: Tue, 3 Dec 2013 11:05:25 -0800 Subject: [PATCH] create table generator code review --- .../cassandra/core/HostMapper.java | 15 ++ .../cassandra/core/KeyType.java | 19 --- .../cassandra/core/Ordering.java | 15 ++ .../cassandra/core/PrimaryKeyType.java | 35 +++++ .../cassandra/core/ResultSetExtractor.java | 15 ++ .../core/ResultSetFutureExtractor.java | 15 ++ .../cassandra/core/RowCallbackHandler.java | 15 ++ .../cassandra/core/RowMapper.java | 15 ++ .../cassandra/core/cql/CqlStringUtils.java | 15 ++ .../cql/generator/AddColumnCqlGenerator.java | 15 ++ .../generator/AlterColumnCqlGenerator.java | 15 ++ .../cql/generator/AlterTableCqlGenerator.java | 15 ++ .../generator/ColumnChangeCqlGenerator.java | 15 ++ .../generator/CreateTableCqlGenerator.java | 129 ++++++++++-------- .../cql/generator/DropColumnCqlGenerator.java | 15 ++ .../cql/generator/DropTableCqlGenerator.java | 15 ++ .../core/cql/generator/TableCqlGenerator.java | 15 ++ .../cql/generator/TableNameCqlGenerator.java | 15 ++ .../generator/TableOptionsCqlGenerator.java | 15 ++ .../core/keyspace/AddColumnSpecification.java | 15 ++ .../keyspace/AlterColumnSpecification.java | 15 ++ .../keyspace/AlterTableSpecification.java | 15 ++ .../keyspace/ColumnChangeSpecification.java | 15 ++ .../core/keyspace/ColumnSpecification.java | 41 ++++-- .../ColumnTypeChangeSpecification.java | 15 ++ .../keyspace/CreateTableSpecification.java | 15 ++ .../core/keyspace/DefaultOption.java | 15 ++ .../core/keyspace/DefaultTableDescriptor.java | 15 ++ .../keyspace/DropColumnSpecification.java | 15 ++ .../core/keyspace/DropTableSpecification.java | 15 ++ .../cassandra/core/keyspace/Option.java | 15 ++ .../core/keyspace/TableDescriptor.java | 15 ++ .../core/keyspace/TableNameSpecification.java | 15 ++ .../core/keyspace/TableOperations.java | 15 ++ .../cassandra/core/keyspace/TableOption.java | 15 ++ .../keyspace/TableOptionsSpecification.java | 15 ++ .../core/keyspace/TableSpecification.java | 35 +++-- .../cassandra/core/util/MapBuilder.java | 15 ++ 38 files changed, 656 insertions(+), 98 deletions(-) delete mode 100644 spring-cassandra/src/main/java/org/springframework/cassandra/core/KeyType.java create mode 100644 spring-cassandra/src/main/java/org/springframework/cassandra/core/PrimaryKeyType.java diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/HostMapper.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/HostMapper.java index 66b81f3da..dee1969b7 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/HostMapper.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/HostMapper.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core; import java.util.Collection; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/KeyType.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/KeyType.java deleted file mode 100644 index 692920091..000000000 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/KeyType.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.springframework.cassandra.core; - -/** - * Values representing primary key column types. - * - * @author Matthew T. Adams - */ -public enum KeyType { - - /** - * Used for a column that is a primary key and that also is or is part of the partition key. - */ - PARTITION, - - /** - * Used for a primary key column that is not part of the partition key. - */ - PRIMARY -} \ No newline at end of file diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/Ordering.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/Ordering.java index a9c36d2bb..72fdc7632 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/Ordering.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/Ordering.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core; /** diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/PrimaryKeyType.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/PrimaryKeyType.java new file mode 100644 index 000000000..ce40be882 --- /dev/null +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/PrimaryKeyType.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.cassandra.core; + +/** + * Values representing primary key column types. + * + * @author Matthew T. Adams + * @author Alex Shvid + */ +public enum PrimaryKeyType { + + /** + * Used for a column that is part of the partition key. + */ + PARTITION, + + /** + * Used for a column that is clustered key. + */ + CLUSTERED +} \ No newline at end of file diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetExtractor.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetExtractor.java index 94b03aae9..c6dc5adaa 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetExtractor.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetExtractor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core; import org.springframework.dao.DataAccessException; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetFutureExtractor.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetFutureExtractor.java index 7c52af2eb..750dfa691 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetFutureExtractor.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/ResultSetFutureExtractor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core; import org.springframework.dao.DataAccessException; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowCallbackHandler.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowCallbackHandler.java index 8eaf6da8e..74132fb28 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowCallbackHandler.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowCallbackHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core; import com.datastax.driver.core.Row; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowMapper.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowMapper.java index 4de62c128..2f10fccb1 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowMapper.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/RowMapper.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core; import com.datastax.driver.core.Row; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/CqlStringUtils.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/CqlStringUtils.java index 614dd14ab..420924579 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/CqlStringUtils.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/CqlStringUtils.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql; import java.util.regex.Pattern; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AddColumnCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AddColumnCqlGenerator.java index e64d1acf7..086770417 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AddColumnCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AddColumnCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterColumnCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterColumnCqlGenerator.java index 51759379e..629805008 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterColumnCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterColumnCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGenerator.java index 42ec89f19..9b15cdd5f 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/ColumnChangeCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/ColumnChangeCqlGenerator.java index ee1402f13..6a6bf2b6d 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/ColumnChangeCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/ColumnChangeCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import org.springframework.cassandra.core.keyspace.ColumnChangeSpecification; 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 ad433a5cb..f1d19a9c7 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 @@ -1,8 +1,23 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; -import static org.springframework.cassandra.core.KeyType.PARTITION; -import static org.springframework.cassandra.core.KeyType.PRIMARY; +import static org.springframework.cassandra.core.PrimaryKeyType.PARTITION; +import static org.springframework.cassandra.core.PrimaryKeyType.CLUSTERED; import java.util.ArrayList; import java.util.List; @@ -16,6 +31,7 @@ import org.springframework.cassandra.core.keyspace.Option; * CQL generator for generating a CREATE TABLE statement. * * @author Matthew T. Adams + * @author Alex Shvid */ public class CreateTableCqlGenerator extends TableCqlGenerator { @@ -49,92 +65,54 @@ public class CreateTableCqlGenerator extends TableCqlGenerator partitionKeys = new ArrayList(); - List primaryKeys = new ArrayList(); + List clusteredKeys = new ArrayList(); for (ColumnSpecification col : spec().getColumns()) { col.toCql(cql).append(", "); if (col.getKeyType() == PARTITION) { partitionKeys.add(col); - } else if (col.getKeyType() == PRIMARY) { - primaryKeys.add(col); + } else if (col.getKeyType() == CLUSTERED) { + clusteredKeys.add(col); } } // begin primary key clause - cql.append("PRIMARY KEY "); - StringBuilder partitions = new StringBuilder(); - StringBuilder primaries = new StringBuilder(); + cql.append("PRIMARY KEY ("); if (partitionKeys.size() > 1) { - partitions.append("("); + // begin partition key clause + cql.append("("); } - boolean first = true; - for (ColumnSpecification col : partitionKeys) { - if (first) { - first = false; - } else { - partitions.append(", "); - } - partitions.append(col.getName()); + appendColumnNames(cql, partitionKeys); - } if (partitionKeys.size() > 1) { - partitions.append(")"); + cql.append(")"); + // end partition key clause } - StringBuilder clustering = null; - boolean clusteringFirst = true; - first = true; - for (ColumnSpecification col : primaryKeys) { - if (first) { - first = false; - } else { - primaries.append(", "); - } - primaries.append(col.getName()); + appendColumnNames(cql, clusteredKeys); - if (col.getOrdering() != null) { // then ordering specified - if (clustering == null) { // then initialize clustering clause - clustering = new StringBuilder().append("CLUSTERING ORDER BY ("); - } - if (clusteringFirst) { - clusteringFirst = false; - } else { - clustering.append(", "); - } - clustering.append(col.getName()).append(" ").append(col.getOrdering().cql()); - } - } - if (clustering != null) { // then end clustering option - clustering.append(")"); - } - - boolean parenthesize = true;// partitionKeys.size() + primaryKeys.size() > 1; - - cql.append(parenthesize ? "(" : ""); - cql.append(partitions); - cql.append(primaryKeys.size() > 0 ? ", " : ""); - cql.append(primaries); - cql.append(parenthesize ? ")" : ""); + cql.append(")"); // end primary key clause cql.append(")"); // end columns + StringBuilder ordering = createOrderingClause(clusteredKeys); // begin options // begin option clause Map options = spec().getOptions(); - if (clustering != null || !options.isEmpty()) { + if (ordering != null || !options.isEmpty()) { // option preamble - first = true; + boolean first = true; cql.append(" WITH "); // end option preamble - if (clustering != null) { - cql.append(clustering); + if (ordering != null) { + cql.append(ordering); first = false; } if (!options.isEmpty()) { @@ -170,4 +148,43 @@ public class CreateTableCqlGenerator extends TableCqlGenerator columns) { + StringBuilder ordering = null; + boolean first = true; + for (ColumnSpecification col : columns) { + + if (col.getOrdering() != null) { // then ordering specified + if (ordering == null) { // then initialize ordering clause + ordering = new StringBuilder().append("CLUSTERING ORDER BY ("); + } + if (first) { + first = false; + } else { + ordering.append(", "); + } + ordering.append(col.getName()).append(" ").append(col.getOrdering().cql()); + } + } + if (ordering != null) { // then end ordering option + ordering.append(")"); + } + return ordering; + } + + private static void appendColumnNames(StringBuilder str, List columns) { + + boolean first = true; + for (ColumnSpecification col : columns) { + if (first) { + first = false; + } else { + str.append(", "); + } + str.append(col.getName()); + + } + + } + } diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropColumnCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropColumnCqlGenerator.java index 1f10f6a30..500ca2d59 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropColumnCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropColumnCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropTableCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropTableCqlGenerator.java index 21049e638..fafb81211 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropTableCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/DropTableCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableCqlGenerator.java index 3887f01bc..10e883349 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.escapeSingle; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableNameCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableNameCqlGenerator.java index b36c62b96..a09d4355d 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableNameCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableNameCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import org.springframework.cassandra.core.keyspace.TableNameSpecification; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableOptionsCqlGenerator.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableOptionsCqlGenerator.java index 3ddbaa40a..dc98ce529 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableOptionsCqlGenerator.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/cql/generator/TableOptionsCqlGenerator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.cql.generator; import static org.springframework.cassandra.core.cql.CqlStringUtils.escapeSingle; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AddColumnSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AddColumnSpecification.java index e42adcefd..dd77a2abf 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AddColumnSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AddColumnSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import com.datastax.driver.core.DataType; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterColumnSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterColumnSpecification.java index d64fc6406..27d287555 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterColumnSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterColumnSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import com.datastax.driver.core.DataType; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterTableSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterTableSpecification.java index 7e192133e..80db2ce22 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterTableSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/AlterTableSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import java.util.ArrayList; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnChangeSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnChangeSpecification.java index 6344b888f..2c9eebc8c 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnChangeSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnChangeSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import static org.springframework.cassandra.core.cql.CqlStringUtils.checkIdentifier; 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 b14635d0e..12c673201 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 @@ -1,13 +1,28 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import static org.springframework.cassandra.core.cql.CqlStringUtils.checkIdentifier; import static org.springframework.cassandra.core.cql.CqlStringUtils.identifize; import static org.springframework.cassandra.core.cql.CqlStringUtils.noNull; -import static org.springframework.cassandra.core.KeyType.PARTITION; -import static org.springframework.cassandra.core.KeyType.PRIMARY; +import static org.springframework.cassandra.core.PrimaryKeyType.PARTITION; +import static org.springframework.cassandra.core.PrimaryKeyType.CLUSTERED; import static org.springframework.cassandra.core.Ordering.ASCENDING; -import org.springframework.cassandra.core.KeyType; +import org.springframework.cassandra.core.PrimaryKeyType; import org.springframework.cassandra.core.Ordering; import com.datastax.driver.core.DataType; @@ -31,7 +46,7 @@ public class ColumnSpecification { private String name; private DataType type; // TODO: determining if we should be coupling this to Datastax Java Driver type? - private KeyType keyType; + private PrimaryKeyType keyType; private Ordering ordering; /** @@ -57,7 +72,7 @@ public class ColumnSpecification { /** * Identifies this column as a primary key column that is also part of a partition key. Sets the column's - * {@link #keyType} to {@link KeyType#PARTITION} and its {@link #ordering} to null. + * {@link #keyType} to {@link PrimaryKeyType#PARTITION} and its {@link #ordering} to null. * * @return this */ @@ -68,7 +83,7 @@ public class ColumnSpecification { /** * Toggles the identification of this column as a primary key column that also is or is part of a partition key. Sets * {@link #ordering} to null and, if the given boolean is true, then sets the column's - * {@link #keyType} to {@link KeyType#PARTITION}, else sets it to null. + * {@link #keyType} to {@link PrimaryKeyType#PARTITION}, else sets it to null. * * @return this */ @@ -80,7 +95,7 @@ public class ColumnSpecification { /** * Identifies this column as a primary key column with default ordering. Sets the column's {@link #keyType} to - * {@link KeyType#PRIMARY} and its {@link #ordering} to {@link #DEFAULT_ORDERING}. + * {@link PrimaryKeyType#CLUSTERED} and its {@link #ordering} to {@link #DEFAULT_ORDERING}. * * @return this */ @@ -90,7 +105,7 @@ public class ColumnSpecification { /** * Identifies this column as a primary key column with the given ordering. Sets the column's {@link #keyType} to - * {@link KeyType#PRIMARY} and its {@link #ordering} to the given {@link Ordering}. + * {@link PrimaryKeyType#CLUSTERED} and its {@link #ordering} to the given {@link Ordering}. * * @return this */ @@ -100,13 +115,13 @@ public class ColumnSpecification { /** * Toggles the identification of this column as a primary key column. If the given boolean is true, then - * sets the column's {@link #keyType} to {@link KeyType#PARTITION} and {@link #ordering} to the given {@link Ordering} - * , else sets both {@link #keyType} and {@link #ordering} to null. + * sets the column's {@link #keyType} to {@link PrimaryKeyType#PARTITION} and {@link #ordering} to the given + * {@link Ordering} , else sets both {@link #keyType} and {@link #ordering} to null. * * @return this */ public ColumnSpecification primary(Ordering order, boolean primary) { - this.keyType = primary ? PRIMARY : null; + this.keyType = primary ? CLUSTERED : null; this.ordering = primary ? order : null; return this; } @@ -116,7 +131,7 @@ public class ColumnSpecification { * * @return this */ - /* package */ColumnSpecification keyType(KeyType keyType) { + /* package */ColumnSpecification keyType(PrimaryKeyType keyType) { this.keyType = keyType; return this; } @@ -143,7 +158,7 @@ public class ColumnSpecification { return type; } - public KeyType getKeyType() { + public PrimaryKeyType getKeyType() { return keyType; } diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnTypeChangeSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnTypeChangeSpecification.java index 3f1a4d4f9..c978623f2 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnTypeChangeSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/ColumnTypeChangeSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import org.springframework.util.Assert; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/CreateTableSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/CreateTableSpecification.java index 28981ede9..b1b912142 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/CreateTableSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/CreateTableSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; /** diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultOption.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultOption.java index 093409870..c48923d6b 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultOption.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultOption.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import static org.springframework.cassandra.core.cql.CqlStringUtils.escapeSingle; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultTableDescriptor.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultTableDescriptor.java index 0e7c24638..c39ed0dd8 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultTableDescriptor.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DefaultTableDescriptor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; /** diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropColumnSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropColumnSpecification.java index d485b852c..19adf19b1 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropColumnSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropColumnSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; public class DropColumnSpecification extends ColumnChangeSpecification { diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropTableSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropTableSpecification.java index a3e66b274..33986d767 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropTableSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/DropTableSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; /** diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/Option.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/Option.java index 055512414..beb2f9ddc 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/Option.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/Option.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; /** diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableDescriptor.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableDescriptor.java index 2a17486a0..300826fb0 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableDescriptor.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableDescriptor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import java.util.List; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableNameSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableNameSpecification.java index 2cf3b993e..f99addd15 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableNameSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableNameSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import static org.springframework.cassandra.core.cql.CqlStringUtils.checkIdentifier; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOperations.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOperations.java index 0f85aa421..57543e49f 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOperations.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOperations.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; /** diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOption.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOption.java index 7f6d56fca..c76629056 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOption.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOption.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import java.util.Map; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOptionsSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOptionsSpecification.java index de6c8d9d2..ad603a118 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOptionsSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableOptionsSpecification.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; import static org.springframework.cassandra.core.cql.CqlStringUtils.escapeSingle; diff --git a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableSpecification.java b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableSpecification.java index b583eeb7e..512c8af2e 100644 --- a/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableSpecification.java +++ b/spring-cassandra/src/main/java/org/springframework/cassandra/core/keyspace/TableSpecification.java @@ -1,14 +1,29 @@ +/* + * Copyright 2011-2013 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.cassandra.core.keyspace; -import static org.springframework.cassandra.core.KeyType.PARTITION; -import static org.springframework.cassandra.core.KeyType.PRIMARY; +import static org.springframework.cassandra.core.PrimaryKeyType.PARTITION; +import static org.springframework.cassandra.core.PrimaryKeyType.CLUSTERED; import static org.springframework.cassandra.core.Ordering.ASCENDING; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.springframework.cassandra.core.KeyType; +import org.springframework.cassandra.core.PrimaryKeyType; import org.springframework.cassandra.core.Ordering; import com.datastax.driver.core.DataType; @@ -83,7 +98,7 @@ public class TableSpecification extends TableOptionsSpecification extends TableOptionsSpecification