DATACASS-272 - Consistently use Spring Data for Apache Cassandra.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
= New & Noteworthy
|
||||
|
||||
[[new-features:1-5-0]]
|
||||
== What's new in Spring Data Cassandra 1.5
|
||||
== What's new in Spring Data for Apache Cassandra 1.5
|
||||
* Assert compatibility with Cassandra 3.0 and Cassandra Java Driver 3.0.
|
||||
* Configurable `ProtocolVersion` and `QueryOptions` on `Cluster` level.
|
||||
* Support for `Optional` as query method result and argument.
|
||||
|
||||
@@ -10,11 +10,11 @@ This document is the reference guide for Spring Data support for Cassandra. It e
|
||||
semantics and the syntax for various stores namespaces.
|
||||
|
||||
This section provides a basic introduction to Spring, Spring Data and the Cassandra database. The rest of the document
|
||||
refers only to Spring Data Cassandra features and assumes the user is familiar with Cassandra as well as
|
||||
refers only to Spring Data for Apache Cassandra features and assumes the user is familiar with Cassandra as well as
|
||||
core Spring concepts.
|
||||
|
||||
This section provides some basic introduction to Spring and Cassandra database. The rest of the document
|
||||
refers only to Spring Data Cassandra features and assumes the user is familiar with Apache Cassandra as
|
||||
refers only to Spring Data for Apache Cassandra features and assumes the user is familiar with Apache Cassandra as
|
||||
well as Spring concepts.
|
||||
|
||||
[[get-started:first-steps:spring]]
|
||||
@@ -34,7 +34,7 @@ behind IoC should be familiar no matter what IoC container you choose to use.
|
||||
|
||||
The core functionality of the Cassandra support can be used directly, with no need to invoke the IoC services
|
||||
of the Spring container. This is much like `JdbcTemplate`, which can be used 'standalone' without any other services
|
||||
of the Spring container. To leverage all the features of Spring Data Cassandra, such as the repository support,
|
||||
of the Spring container. To leverage all the features of Spring Data for Apache Cassandra, such as the repository support,
|
||||
you will need to configure some parts of the library using Spring.
|
||||
|
||||
To learn more about Spring, you can refer to the comprehensive (and sometimes disarming) http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/[documentation]
|
||||
@@ -47,7 +47,7 @@ Take a look at the Spring Framework http://projects.spring.io/spring-framework/[
|
||||
NoSQL stores have taken the storage world by storm. It is a vast domain with a plethora of solutions, terms and patterns
|
||||
(to make things worse, even the term itself has multiple http://www.google.com/search?q=nosoql+acronym[meanings]).
|
||||
While some of the principles are common, it is crucial that the user is familiar to some degree with
|
||||
the Cassandra Columnar NoSQL Datastore supported by Spring Data Cassandra. The best way to get acquainted with Cassandra
|
||||
the Cassandra Columnar NoSQL Datastore supported by Spring Data for Apache Cassandra. The best way to get acquainted with Cassandra
|
||||
is to read the documentation and follow the examples. It usually doesn't take more then 5-10 minutes to go through them
|
||||
and if you are coming from a RDBMS background, many times these exercises can be an eye opener.
|
||||
|
||||
@@ -65,14 +65,14 @@ with a Apache Cassandra instance in combination with the online shell.
|
||||
[[requirements]]
|
||||
== Requirements
|
||||
|
||||
Spring Data Cassandra 1.x binaries require JDK level 6.0 and above, and http://spring.io/docs[Spring Framework] {springVersion} and above.
|
||||
Spring Data for Apache Cassandra 1.x binaries require JDK level 6.0 and above, and http://spring.io/docs[Spring Framework] {springVersion} and above.
|
||||
|
||||
In terms of http://cassandra.apache.org/[Cassandra] at least 2.0.
|
||||
|
||||
== Additional Help Resources
|
||||
|
||||
Learning a new framework is not always straight forward. In this section, we try to provide what we
|
||||
think is an easy to follow guide for starting with Spring Data Cassandra module.
|
||||
think is an easy to follow guide for starting with Spring Data for Apache Cassandra module.
|
||||
However, if you encounter issues or you are just looking for an advice, feel free to use one of the links below:
|
||||
|
||||
[[get-started:help]]
|
||||
@@ -102,11 +102,11 @@ http://pivotal.io/[Pivotal Sofware, Inc.], the company behind Spring Data and Sp
|
||||
[[get-started:up-to-date]]
|
||||
=== Following Development
|
||||
|
||||
For information on the Spring Data Cassandra source code repository, nightly builds and snapshot artifacts
|
||||
please see the http://projects.spring.io/spring-data-cassandra/[Spring Data Cassandra homepage].
|
||||
For information on the Spring Data for Apache Cassandra source code repository, nightly builds and snapshot artifacts
|
||||
please see the http://projects.spring.io/spring-data-cassandra/[Spring Data for Apache Cassandra homepage].
|
||||
You can help make Spring Data best serve the needs of the Spring community by interacting with developers
|
||||
through the Community on http://stackoverflow.com/questions/tagged/spring-data[Stackoverflow].
|
||||
To follow developer activity look for the mailing list information on the Spring Data Cassandra homepage.
|
||||
To follow developer activity look for the mailing list information on the Spring Data for Apache Cassandra homepage.
|
||||
If you encounter a bug or want to suggest an improvement, please create a ticket on the Spring Data issue
|
||||
https://jira.spring.io/browse/DATACASS[tracker]. To stay up to date with the latest news and announcements
|
||||
in the Spring eco system, subscribe to the Spring Community http://spring.io[Portal].
|
||||
|
||||
@@ -219,7 +219,7 @@ include::../{spring-data-commons-docs}/repository-projections.adoc[leveloffset=+
|
||||
[[cassandra.repositories.misc.cdi-integration]]
|
||||
=== CDI Integration
|
||||
|
||||
Instances of the repository interfaces are usually created by a container, which Spring is the most natural choice when working with Spring Data. Spring Data Cassandra ships with a custom CDI extension that allows using the repository abstraction in CDI environments. The extension is part of the JAR so all you need to do to activate it is dropping the Spring Data Cassandra JAR into your classpath. You can now set up the infrastructure by implementing a CDI Producer for the `CassandraTemplate`:
|
||||
Instances of the repository interfaces are usually created by a container, which Spring is the most natural choice when working with Spring Data. Spring Data for Apache Cassandra ships with a custom CDI extension that allows using the repository abstraction in CDI environments. The extension is part of the JAR so all you need to do to activate it is dropping the Spring Data for Apache Cassandra JAR into your classpath. You can now set up the infrastructure by implementing a CDI Producer for the `CassandraTemplate`:
|
||||
|
||||
[source,java]
|
||||
----
|
||||
|
||||
@@ -17,15 +17,15 @@ Includes integrated object mapping between CQL Tables and POJOs.
|
||||
For most data oriented tasks you will use the `CassandraTemplate` or the `Repository` support, which leverage the
|
||||
rich mapping functionality. `CassandraTemplate` is commonly used to increment counters or perform ad-hoc CRUD
|
||||
operations. `CassandraTemplate` also provides callback methods making it easy to get a hold of low-level API objects
|
||||
such as `com.datastax.driver.core.Session` allowing you to communicate directly with Cassandra. Spring Data Cassandra
|
||||
such as `com.datastax.driver.core.Session` allowing you to communicate directly with Cassandra. Spring Data for Apache Cassandra
|
||||
uses consistent naming conventions on objects in various APIs to those found in the DataStax Java Driver so that they
|
||||
are familiar and so you can map your existing knowledge onto the Spring APIs.
|
||||
|
||||
|
||||
[[cassandra.modules]]
|
||||
== Spring CQL and Spring Data Cassandra modules
|
||||
== Spring CQL and Spring Data for Apache Cassandra modules
|
||||
|
||||
Spring Data for Apache Cassandra comes with two modules: Spring CQL and Spring Data Cassandra.
|
||||
Spring Data for Apache Cassandra comes with two modules: Spring CQL and Spring Data for Apache Cassandra.
|
||||
|
||||
The value-add provided by the Spring Data for Apache Cassandra abstraction is perhaps best shown by the sequence of actions outlined in the table below. The table shows what actions Spring will take care of and which actions are the responsibility of you, the application developer.
|
||||
|
||||
@@ -72,7 +72,7 @@ The value-add provided by the Spring Data for Apache Cassandra abstraction is pe
|
||||
|===
|
||||
|
||||
Spring CQL takes care of all the low-level details that can make Cassandra and CQL such a
|
||||
tedious API to develop with. Spring Data Cassandra adds object mapping, schema generation and repository support to the featureset.
|
||||
tedious API to develop with. Spring Data for Apache Cassandra adds object mapping, schema generation and repository support to the featureset.
|
||||
|
||||
|
||||
[[cassandra.choose-style]]
|
||||
@@ -365,9 +365,9 @@ public class CassandraConfig {
|
||||
----
|
||||
====
|
||||
|
||||
Creating configuration classes registering Spring Data Cassandra components can get an exhausing challenge so Spring Data Cassandra comes with a prebuilt configuration support class. Classes extending from `AbstractCassandraConfiguration` will register beans for Spring Data Cassandra use. `AbstractCassandraConfiguration` lets you provide various configuration options such as initial entities, default query options, socket options, pooling options and much more. `AbstractCassandraConfiguration` will support you also with schema generation based on initial entities, if any provided. Extending from `AbstractCassandraConfiguration` requires you to at least provide the keyspace name by implementing the `getKeyspaceName` method.
|
||||
Creating configuration classes registering Spring Data for Apache Cassandra components can get an exhausing challenge so Spring Data for Apache Cassandra comes with a prebuilt configuration support class. Classes extending from `AbstractCassandraConfiguration` will register beans for Spring Data for Apache Cassandra use. `AbstractCassandraConfiguration` lets you provide various configuration options such as initial entities, default query options, socket options, pooling options and much more. `AbstractCassandraConfiguration` will support you also with schema generation based on initial entities, if any provided. Extending from `AbstractCassandraConfiguration` requires you to at least provide the keyspace name by implementing the `getKeyspaceName` method.
|
||||
|
||||
.Registering Spring Data Cassandra beans using AbstractCassandraConfiguration
|
||||
.Registering Spring Data for Apache Cassandra beans using AbstractCassandraConfiguration
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
@@ -514,7 +514,7 @@ your base packages to scan here -->
|
||||
[[cassandra-schema-management]]
|
||||
== Schema Management
|
||||
|
||||
Apache Cassandra is a data store that requires a schema definition prior to any data interaction. Spring Data Cassandra can support you with that task.
|
||||
Apache Cassandra is a data store that requires a schema definition prior to any data interaction. Spring Data for Apache Cassandra can support you with that task.
|
||||
|
||||
=== Keyspaces and Lifecycle scripts
|
||||
|
||||
@@ -618,7 +618,7 @@ NOTE: Keyspace creation allows rapid bootstrapping without the need of external
|
||||
|
||||
=== Tables and User-defined types
|
||||
|
||||
Spring Data Cassandra's approaches data access with mapped entity classes that fit your data model. These entity classes can be used to create Cassandra table specifications and user type definitions.
|
||||
Spring Data for Apache Cassandra's approaches data access with mapped entity classes that fit your data model. These entity classes can be used to create Cassandra table specifications and user type definitions.
|
||||
|
||||
Schema creation is tied to `Session` initialization with `SchemaAction`. Following actions are supported:
|
||||
|
||||
@@ -1203,7 +1203,7 @@ static class PersonReadConverter implements Converter<String, Person> {
|
||||
[[cassandra.custom-converters.java]]
|
||||
=== Registering Spring Converters with the CassandraConverter
|
||||
|
||||
The Spring Data Cassandra Java Config provides a convenient way to register Spring `Converter` s with the `MappingCassandraConverter`. The configuration snippet below shows how to manually register converters as well as configuring the `CustomConversions`.
|
||||
The Spring Data for Apache Cassandra Java Config provides a convenient way to register Spring `Converter` s with the `MappingCassandraConverter`. The configuration snippet below shows how to manually register converters as well as configuring the `CustomConversions`.
|
||||
|
||||
[source,java]
|
||||
----
|
||||
|
||||
@@ -22,8 +22,8 @@ TODO
|
||||
[[mapping-conversion]]
|
||||
== Data mapping and type conversion
|
||||
|
||||
This section explain how types are mapped to a Cassandra representation and vice versa. Spring Data Cassandra supports several types that are provided by Apache Cassandra.
|
||||
In addition to these types, Spring Data Cassandra provides a set of built-in converters to map additional types. You can provide your own converters to adjust type conversion, see <<cassandra.mapping.explicit-converters>> for further details.
|
||||
This section explain how types are mapped to a Cassandra representation and vice versa. Spring Data for Apache Cassandra supports several types that are provided by Apache Cassandra.
|
||||
In addition to these types, Spring Data for Apache Cassandra provides a set of built-in converters to map additional types. You can provide your own converters to adjust type conversion, see <<cassandra.mapping.explicit-converters>> for further details.
|
||||
|
||||
[cols="3,2", options="header"]
|
||||
.Type
|
||||
|
||||
Reference in New Issue
Block a user