Commit Graph

100 Commits

Author SHA1 Message Date
Mark Paluch
580adfb5c1 DATACASS-206 - Fix delete using custom column names.
We now use the specified column name from the entity annotation to construct the where clause in a delete statement.

Original pull request: #73.
2016-07-01 14:35:29 -07:00
Mark Paluch
66a69c0926 DATACASS-296 - Use CustomConversions for JSR-310, Joda and ThreeTen Backport types.
We now allow registering CustomConversions to register custom converters (read and write targets). CustomConversions registers by default JSR-310, Joda Time and ThreeTen backport type converters.
These types (LocalDate, LocalDateTime) can be used in domain classes and with query method arguments. Date-only types map to Cassandra's date type, Date and time types map to Cassandra's timestamp type. Type mapping works for singular and collection types (List and Set).

```
@Table
public Person

    @Id String id;

    java.time.LocalDate date;

    @CassandraType(type = Name.TIMESTAMP)
    java.time.LocalDate timestamp;

    List<org.threeten.bp.Instant> timestamps;
}
```

Original pull request: #68.
2016-06-29 19:21:08 -07:00
John Blum
fae1ba8591 DATACASS-192 - Polish.
Original pull request: #69.
2016-06-28 14:30:57 -07:00
Mark Paluch
f1e3ef48e8 DATACASS-192 - Support RENAME and DROP in ALTER TABLE specification.
Extend alter table specification and the linked CQL generator to support RENAME and DROP operations. Cleanup code in that area.

Original pull request: #69.
2016-06-28 14:30:50 -07:00
Mark Paluch
38fef212e4 DATACASS-192 - Fix syntax error when adding columns using CQL generators.
The Add-Column CQL generator now generates correct CQL statements.

Original pull request: #69.
2016-06-28 14:30:40 -07:00
John Blum
f30468627d DATACASS-298 - Fix DATACASS-176 issue reference hyperlink. 2016-06-20 14:09:08 -07:00
John Blum
2958d13923 DATACASS-242 - Fix shutdown script issue with XML Configuration.
The XML Configuration now handles configured shutdown scripts correctly.

Original pull request: #67.
2016-06-20 09:37:06 +02:00
Mark Paluch
56c46f9460 DATACASS-298 - Polishing.
Extends date range in license headers. Apply formatting rules. Create BeanDefinitionTestUtils and simplify tests. Add ticket references.

Original pull request: #66.
2016-06-20 09:15:47 +02:00
John Blum
3d9835d99a DATACASS-298 - Add missing PoolingOptions to the XML namespace as well as the PoolingOptionsFactoryBean.
Original pull request: #66.
2016-06-20 09:15:33 +02:00
John Blum
97be7d6fc3 DATACASS-297 - Polish.
Original pull request: #65.
2016-06-14 15:57:55 -07:00
Mark Paluch
1b4eec9dd4 DATACASS-297 - Add support for streaming queries to select entities.
We now support java.util.stream.Stream as return type on query methods. Streaming queries wrap the iterator returned by Cassandra's ResultSet. Elements are fetched in batches (see QueryOptions that can be set in CassandraCqlClusterFactoryBean) and processed element by element instead of reading all results. Streaming queries are supported only for select queries.

Original pull request: #65.
2016-06-14 15:57:47 -07:00
John Blum
f6aef61d51 DATACASS-287 - Polish.
Original pull request: #63.
2016-06-03 14:44:21 -07:00
Mark Paluch
76f3d32360 DATACASS-287 - Polishing.
Move test listeners into a common support package. Hide constructors and introduce factory methods. Encapsulate fields. Add volatile modifier to fields to prevent visibility issues. Enhance JavaDoc on CassandraOperations.
2016-06-03 14:44:11 -07:00
Mark Paluch
b14956cb67 DATACASS-287 - Call QueryForObjectListener for absent singular responses.
QueryForObjectListener is now called passing null for absent responses when querying for one single object.
2016-06-03 14:43:51 -07:00
John Blum
165064084a DATACASS-253 - Polish.
Original pull request: #62.
2016-06-03 12:29:50 -07:00
Mark Paluch
39dca76e7c DATACASS-253 - Add synchronization to CachedPreparedStatementCreator.
CachedPreparedStatementCreator is now thread-safe and synchronizes concurrent calls to statement preparation. The synchronization prevents multiple calls to Session.prepare(…) for the same session, CQL statement and keyspace.
2016-06-03 12:25:01 -07:00
Mark Paluch
abcac5f5ee DATACASS-263 - Fix authentication configuration in CassandraCqlClusterFactoryBean.
Configuring username/password authentication does no longer require setting of an AuthProvider which would be overwritten by the username/password authenticator.
2016-06-03 10:08:23 +02:00
Mark Paluch
1d1ba3d998 DATACASS-286 - Polishing.
Update years in license headers where needed. Apply Spring Data formatting to method blocks. Add issue reference to tests. Remove trailing whitespaces. Remove throws declarations in CqlTemplate for runtime exceptions. Add author tags. Adjust JavaDoc about not null parameters. Align not null assertion messages with Spring Data wording.

Original pull request: #61.
2016-05-30 10:24:43 +02:00
John Blum
39928948f0 DATACASS-286 - Log all CQL queries executed with CqlTemplate.
Additional refactoring to simplify CqlTemplate logic as well as make CqlTemplate methods more behaviorally consistent.

Origina pull request: #61.
2016-05-30 10:24:32 +02:00
Mark Paluch
be495728d9 DATACASS-271 - Polishing.
Add author tags. Add/update license headers where needed. Remove calls to deprecated methods. Adopt pooling options after the driver update. Add hints_directory for Cassandra 3.

Reduce driver baseline to core driver 3.0.1. The DSE driver requires the core driver itself and can be added as dependency to user projects while retaining full compatibility. As of now the DSE driver is rc1 hence it requires core rc1.

Use getTimestamp for timestamp type methods as the driver aligned the method to the type. Support short, byte and time. Enable LocalDate return type and add tests for native supported types.

Change long to bigint type as long was mapped to the counter type when creating tables. Align the default to bigint as bigint is the better choice since table creation uses mostly regular tables and not counter tables. Type can be overriden using @CassandraType.

We now support setting NettyOptions on CassandraCqlClusterFactoryBean and AbstractClusterConfiguration. The cassandra driver 2.1.9 changed its default shutdown behavior by introducing a 2 second quiet period when shutting down Cluster instances. This change was retained throughout the 3.0 driver which slow the test down by an order of magnitude. Configure QueryOptions on tests to prevent delays caused by the asynchronous schema refresh.

Original pull request: #56.
Related pull request: #52.
Related ticket: DATACASS-169.
2016-05-20 12:54:19 -07:00
Antoine Toulme
a920b530df DATACASS-271 - Upgrade to Cassandra 3.0.
This commit adds support for Cassandra 3.x with upgrading to Datastax Driver 3.0.0. Data type deserialization is performed using the CodecRegistry.

Original pull request: #52.
Related ticket: DATACASS-169.
2016-05-20 12:54:11 -07:00
John Blum
27019f3218 DATACASS-219 - Polish.
Refactored code based on @Mark Paluch's code review here (https://github.com/spring-projects/spring-data-cassandra/pull/55).
2016-05-11 11:51:12 -07:00
John Blum
a1e75b3857 DATACASS-219 - On startup CREATE TABLE from entities should only add 'if not exists'. 2016-05-10 20:04:25 -07:00
Mark Paluch
4772c5b628 DATACASS-280 - Refactor Cassandra query execution and mapping to consolidate mapping.
We now support Optional provided by Spring Data Commons on Repository methods carrying the appropriate element type.

This commit refactors the mapping layer for Cassandra query methods with following changes: Pull mapping from AbstractCassandraQuery into AbstractCassandraConverter. Throw UnsupportedOperationException in deprecated AbstractCassandraQuery.setConversionService method. Refactor conditional execution to CassandraQueryExecution pattern and follow CassandraConverters/CustomConversions pattern. Introduce DtoInstantiatingConverter and Reading/Writing converters. Refactor lookup map creation to multiple methods. Rename fields. Remove unused primitiveTypesByWrapperType. Fix error message of getDataTypeNamesFrom method.

Add JavaDoc and extend not-null assertions with a meaningful message.

Remove Java 7 build profile from TravisCI as these changes require the usage of Java 8 within the tests.

Original pull request: #53
Related ticket: DATACASS-247
2016-05-10 17:24:08 +02:00
Mark Paluch
ac321512bb DATACASS-226 - Polishing.
Add tests for CassandraCqlClusterFactoryBean and AbstractClusterConfiguration. Update license headers. Extend JavaDoc. Rearrange fields in CassandraCqlClusterFactoryBean to reflect grouping similar to the client.

Original pull request: #31.
2016-05-10 17:24:07 +02:00
Jorge Davison
1a3a9d9c56 DATACASS-226 - Enable CassandraCqlClusterFactoryBean to set QueryOptions at cluster level.
We now allow configuring QueryOptions on Cluster level.

Original pull request: #31
2016-05-10 15:55:25 +02:00
Mark Paluch
c33d509b8e DATACASS-255 - Cassandra Test cleanup.
Replace CassandraUnit test rule with own test rule that honors the external/embedded Cassandra preference. Move Cassandra server initialization into CassandraRule. Introduce a KeyspaceRule to provide managed keyspaces on test class level. Allow cached cluster connections by enabling CassandraRule as class rule. A test that requires a running Cassandra instance needs to either extend the AbstractEmbeddedCassandraIntegrationTest or add the test rule CassandraRule to its test.

Consolidate connection properties (before merging the spring-cql and spring-data-cassandra modules) and simplify config properties classes. Add cleanup after the test run to remove temporary keyspaces. This change allows repeating test runs on a stateful Cassandra instance (e.g. an externally started Cassandra instance). Rename config file and change references to renamed files to support the consolidated connection properties in context config files.
Removed FunkyIdentifierIntegrationTest as it only tests creating tables using reserved Cassandra words. Spring Data Cassandra does not constrain CQL identifiers so maybe later we'll add a test to verify the implemented rules.

Exclude logback-core dependency from cassandra-all. Remove jamm dependency in tests as it's not used. Removed cassandra-unit dependency as the usage is very little. Removed unnecessary hector dependency.

Rename all integration tests to end with "IntegrationTests" and unit tests to end with "UnitTests". Move unit tests to the system under test package to enable testing of package-private types and members. Add missing license headers and author tags. Reformat all test code using the Spring Data Eclipse formatting.

Original pull request: #51
2016-05-10 11:01:33 +02:00
Mark Paluch
21686dd448 DATACASS-262 - Polishing.
Add author. Update license header. Improve JavaDoc.

Original pull request: #42.
2016-04-28 14:29:32 +02:00
Ryan Scheidter
5dc5cc5196 DATACASS-262 - Add missing throws to catch blocks in CqlTemplate.
While these process methods have quite a few problems and inconsistencies with respect to the exception handling, only the more egregious 'throw' omissions are addressed in this commit.

Original pull request: #42.
2016-04-28 14:29:19 +02:00
Stefan Birkner
b3289af1e2 DATACASS-275 - Don't use deprecated methods.
The method DataType.deserialize(ByteBuffer) is deprecated and throws an `UnsupportedOperationException`.
This methods will be removed in future versions of the driver. By not using them anymore we make it easier to upgrade the driver afterwards.

Original pull request: #49.
Related ticket: DATACASS-198
CLA: 172420160413064110 (Stefan Birkner)
2016-04-27 15:34:05 +02:00
Mark Paluch
a1feafef67 DATACASS-231 - Polishing.
Add author. Add/update license headers where needed. Improve JavaDoc. Tweaked test names. Adopted current driver behavior in tests.

Original pull request: #41.
2016-04-07 11:08:36 +02:00
Kirk Clemens
0f14ade35a DATACASS-231 - Add ProtocolVersion to CassandraCqlClusterFactoryBean.
Original pull request: #41.
CLA: 134320150813044603 (Kirk Clemens)
2016-04-07 11:08:36 +02:00
Oliver Gierke
a453c5e961 DATACASS-264 - Prepare next development iteration. 2016-04-06 16:36:59 +02:00
Oliver Gierke
ecf88c24d3 DATACASS-264 - Release version 1.4 GA (Hopper). 2016-04-06 16:35:58 +02:00
Oliver Gierke
e572723e34 DATACASS-256 - Prepare next development iteration. 2016-03-18 11:15:51 +01:00
Oliver Gierke
4f70ef633c DATACASS-256 - Release version 1.4 RC1 (Hopper). 2016-03-18 11:14:59 +01:00
Oliver Gierke
0de315c0bd DATACASS-251 - Prepare next development iteration. 2016-02-12 15:43:39 +01:00
Oliver Gierke
f35c9d4332 DATACASS-251 - Release version 1.4 M1 (Hopper). 2016-02-12 15:42:46 +01:00
David Webb
237ac88bc5 DATACASS-239 - Upgraded to latest Cassandra, Cassandra unit and Dse driver.
Updated Cassandra-Unit, DSE Driver and Cassandra version to latest stable version. Changed the Test Cases to support the API changes on the driver by DataStax. They changed the exception hierarchy for failed
replication factor quorum. The embedded spring-cassandra.yaml files were tuned to turn of unneeded features that were causing overhead in the testing. Marked new test dependencies as test scope.

Original pull request: #43.
2015-12-23 10:19:52 +01:00
Spring Buildmaster
9351930aef DATACASS-232 - Prepare next development iteration. 2015-09-01 02:00:41 -07:00
Spring Buildmaster
b037d0eb2e DATACASS-232 - Release version 1.3.0.RELEASE (Gosling GA). 2015-09-01 02:00:39 -07:00
Spring Buildmaster
291893b56c DATACASS-230 - Prepare next development iteration. 2015-08-04 04:50:32 -07:00
Spring Buildmaster
9f08df3b27 DATACASS-230 - Release version 1.3.0.RC1 (Gosling RC1). 2015-08-04 04:50:30 -07:00
Oliver Gierke
18953bdfec DATACASS-220 - Downgrade to Cassandra driver 2.1.5.
The integration tests constantly fail on Bamboo on 2.1.6 and seem to be fine on 2.1.5. Downgraded until further diagnose.
2015-06-22 11:59:20 +02:00
Oliver Gierke
4acd159407 DATACASS-220 - Upgraded to Cassandra driver 2.1.6.
Adapted API change in TestLatencyTracker *sigh*. Removed version declaration for Guava to use the one from Spring Data Build.
2015-06-19 12:21:45 +02:00
Spring Buildmaster
7d5a62c504 DATACASS-215 - Prepare next development iteration. 2015-06-02 01:41:15 -07:00
Spring Buildmaster
144b095fab DATACASS-215 - Release version 1.3.0 M1 (Gosling). 2015-06-02 01:41:12 -07:00
Andy Wilkinson
64eb1f738c DATACASS-208 - Removed obsolete dependency to Liquibase.
Original pull request: #33.
2015-04-13 13:47:58 +02:00
Spring Buildmaster
bdf9a990ca DATACASS-207 - Prepare next development iteration. 2015-03-23 05:03:32 -07:00
Spring Buildmaster
ae67ea4c55 DATACASS-207 - Release version 1.2.0.RELEASE. 2015-03-23 05:03:30 -07:00