Commit Graph

1015 Commits

Author SHA1 Message Date
Mark Paluch
5f61faeadb DATACASS-507 - Adapt API changes in Property in test cases. 2017-10-27 11:18:12 +02:00
Mark Paluch
9dce6b7273 DATACASS-506 - Resolve annotated and nested user-defined type references to stubs for UDT creation.
We now resolve user-defined type references to type stubs when constructing the create specification for a user-defined type instead of looking up the type from Cassandra if the particular property is annotated with @CassandraType(type = UDT). This applies to user-defined types nested in the to-be-created type. Stubbing is necessary to not prevent user-type creation during create specification construction. The actual execution happens after all creation specifications are built.
2017-10-24 16:12:57 +02:00
Oliver Gierke
dbd5a0e701 DATACASS-491 - Updated changelog. 2017-10-11 19:01:36 +02:00
Mark Paluch
2dcd9c86e5 DATACASS-502 - Polishing.
Add unit tests for Keyspace create/create-drop.
2017-10-04 11:03:55 +02:00
Mark Paluch
de92c84cab DATACASS-502 - Add support for keyspace alteration on cluster initialization.
We now support keyspace alteration using XML configuration during after CassandraClusterFactoryBean initialization.

Previously, ALTER keyspace actions resulted in IllegalStateException.
2017-10-04 10:47:33 +02:00
Mark Paluch
0f688b878e DATACASS-492 - After release cleanups. 2017-10-02 11:37:23 +02:00
Mark Paluch
7100fcd261 DATACASS-492 - Prepare next development iteration. 2017-10-02 11:37:22 +02:00
Mark Paluch
3d0268ebc4 DATACASS-492 - Release version 2.0 GA (Kay). 2017-10-02 11:10:23 +02:00
Mark Paluch
13440fcbfa DATACASS-492 - Prepare 2.0 GA (Kay). 2017-10-02 11:09:17 +02:00
Mark Paluch
f0f5304993 DATACASS-492 - Updated changelog. 2017-10-02 11:09:12 +02:00
Mark Paluch
243b81fd4f DATACASS-499 - Adapt to changed Spring Framework 5 documentation structure.
Update links in the reference docs to their new locations.
2017-09-27 14:00:09 +02:00
Mark Paluch
9798638e91 DATACASS-495 - Downgrade to CDI 1.0.
We now build against CDI 1.0 again while using CDI 2.0 for testing.
2017-09-21 13:59:20 +02:00
Mark Paluch
0df95821e8 DATACASS-496 - Added explicit automatic module name for JDK 9. 2017-09-21 13:58:53 +02:00
Mark Paluch
d1fb7e2fae DATACASS-495 - Upgrade to OpenWebBeans 2.0.1. 2017-09-18 15:26:23 +02:00
Mark Paluch
43602ae30c DATACASS-494 - Upgrade to embedded Apache Cassandra 3.11.
Upgrade embedded Cassandra version and build profiles.
2017-09-14 12:26:41 +02:00
Mark Paluch
b4ded9168e DATACASS-493 - Update reference documentation for 2.0.
Update what's new and include migration guide.
2017-09-14 11:43:50 +02:00
John Blum
41457a40d1 DATACASS-489 - Polish. 2017-09-13 08:47:23 -07:00
Mark Paluch
4115cd3ca2 DATACASS-489 - Document SessionFactory in reference docs. 2017-09-13 08:41:14 -07:00
John Blum
018aea1288 DATACASS-56 - Polish. 2017-09-11 23:34:44 -07:00
Mark Paluch
90bfa5317b DATACASS-56 - Cassandra paging support.
We now support forward-only paging with Cassandra through the Template API and Repositories. Results in Cassandra are paged by navigating forward-only through pages described by a binary paging state encapsulated by CassandraPageRequest and accessible via the returned Slice. Spring Data Page's do not fit to Cassandra's paging concept because Cassandra paging is not based on limit/offset.

Page requests are applicable to a Query and as parameter of query methods.

Query query = Query.empty().pageRequest(CassandraPageRequest.first(10));
Slice<User> slice = template.slice(query, User.class);

do {

    // consume slice

    if (slice.hasNext()) {
        slice = template.select(query, slice.nextPageable(), User.class);
    } else {
        break;
    }
} while (!slice.getContent().isEmpty());

assertThat(ids).hasSize(100);
assertThat(iterations).isEqualTo(10);

interface UserRepository implements Repository<User, String> {

    Slice<User> findAllByName(String name, Pageable pageRequest);
}
2017-09-11 23:22:43 -07:00
Mark Paluch
62e6d33314 DATACASS-56 - Allow query options mutation.
We now allow query option mutation through QueryOptions.mutate() returning an initialized builder. The mutation builder is initialized with the state of the QueryOptions object and allows further customization without changing the previous state of the immutable QueryOptions object.

QueryOptions queryOptions = …;

QueryOptions mutated = queryOptions.mutate().readTimeout(Duration.ofSeconds(5)).build();
2017-09-11 23:14:43 -07:00
John Blum
1cb5a8bd99 DATACASS-146 - Polish. 2017-09-11 23:14:09 -07:00
Mark Paluch
0ee5190f09 DATACASS-146 - Enhance Repository methods to accept QueryOptions as arguments.
We now support Repository query methods with query options. Query options can be passed either as an additional parameter to a Repository query method or applied with annotation.
Annotation-based query options are supported via @Consistency. A query options parameter has precedence over the annotation if a method declares both, an annotation-based consistency level and accepts a query options parameter.

interface SampleRepository extends Repository<Person, String> {

  @Query("SELECT * FROM person WHERE lastname = ?0;")
  @Consistency(ConsistencyLevel.LOCAL_ONE)
  Person findByLastname(String lastname);

  @Consistency(ConsistencyLevel.LOCAL_ONE)
  Person findByAge(int age);

  Person findByAge(int age, QueryOptions options);
}

SampleRepository repository = …;

repository.findByAge(42, QueryOptions.builder().fetchSize(44).build());
2017-09-11 23:14:00 -07:00
John Blum
d00ff35b19 DATACASS-145 - Polish. 2017-09-11 18:11:46 -07:00
Mark Paluch
997888678a DATACASS-145 - Make SimpleCassandraRepository.createInsert(…) protected.
Expose createInsert(…) in the synchronous and reactive repository base classes to simplify base class extension. Derived classes are no longer required to implement createInsert(…) themselves but can reuse the existing methods. Extract createInsert(…) body to InsertUtil.
2017-09-11 18:11:38 -07:00
John Blum
9fc7cd9eaa DATACASS-467 - Polish. 2017-09-11 16:30:18 -07:00
Mark Paluch
58e7bcc36d DATACASS-467 - Add migration guide describing upgrade paths from 1.5 to 2.0. 2017-09-11 16:29:21 -07:00
Mark Paluch
7e6556e3bd DATACASS-467 - Update documentation. 2017-09-11 16:29:06 -07:00
Oliver Gierke
e084ec2efd DATACASS-480 - After release cleanups. 2017-09-11 17:40:21 +02:00
Oliver Gierke
1cf3595b6b DATACASS-480 - Prepare next development iteration. 2017-09-11 17:40:18 +02:00
Oliver Gierke
bdbcb3565b DATACASS-480 - Release version 2.0 RC3 (Kay). 2017-09-11 17:24:45 +02:00
Oliver Gierke
8aa59ff4a2 DATACASS-480 - Prepare 2.0 RC3 (Kay). 2017-09-11 17:23:52 +02:00
Oliver Gierke
6dc6421076 DATACASS-480 - Updated changelog. 2017-09-11 17:23:44 +02:00
Mark Paluch
e53972880a DATACASS-481 - Updated changelog. 2017-09-11 12:43:51 +02:00
Mark Paluch
759ef416ed DATACASS-490 - Switch to VM-based TravisCI build.
We now switched to VM-based builds by requiring sudo to apply higher memory limits as we exceeded memory limits of the container-based build.
2017-09-05 09:46:35 +02:00
Mark Paluch
183c502f7e DATACASS-128 - Add tests to verify simple type mapping.
Add tests that verify Java class to Cassandra type mapping for simple types that are supported natively by the driver.

Related tickets: DATACASS-271, DATACASS-280, DATACASS-375.
2017-08-30 10:45:52 +02:00
Mark Paluch
b8192424eb DATACASS-488 - Add explicit type mappings for Name.VARCHAR and Name.TEXT.
We map varchar and text types explicitly to data types to ensure resolution to the appropriate data type if queried by name. The driver returns only text via DataType.allPrimitiveTypes() because text and varchar are aliases and allPrimitiveTypes returns a set.
2017-08-04 09:34:24 +02:00
Mark Paluch
57f4c38073 DATACASS-486 - Polishing.
Fix javadoc in synchronous/asynchronous CQL operations.
2017-08-04 08:52:57 +02:00
Mark Paluch
34af38b15f DATACASS-486 - Use unique property names in UDT reference documentation example. 2017-08-04 08:52:57 +02:00
Mark Paluch
7dc3364d8e DATACASS-482 - Polishing.
Reduce method visibility on protected types. Remove deprecated methods. Formatting, reorder methods, Javadoc.

Introduce CqlIdentifier.of(…) and KeyspaceIdentifier.of(…) methods and deprecate CqlIdentifier.cqlId(…) and KeyspaceIdentifier.ksId(…) methods.
2017-08-02 10:17:49 +02:00
Mark Paluch
df045de2fa DATACASS-482 - Refactor KeyspaceActionSpecificationBean to produce KeyspaceActions.
Remove indirection via MultiLevelSetFlattenerFactoryBean and create a KeyspaceActions wrapper that encapsulates the actual actions. Introduce KeyspaceActionSpecificationFactory for keyspace action creation.
2017-08-02 10:17:49 +02:00
Mark Paluch
88d7bb231a DATACASS-482 - Introduce KeyspaceSpecifications factory methods.
Encapsulate required KeyspaceSpecification properties in immutable base classes. Introduce static factory methods to create value objects where possible. Rewrite Javadoc to reflect the nature of configuration objects and not builders since these objects to not build a target object. Refactor duplicate code into utility classes.
2017-08-02 10:17:49 +02:00
Mark Paluch
94d6a3ddc7 DATACASS-482 - Introduce usage of nullable annotations for API validation.
Mark all packages with Spring Frameworks @NonNullApi. Add Spring's @Nullable to methods, parameters and fields that take or produce null values. Adapted using code to make sure the IDE can evaluate the null flow properly. Fix Javadoc in places where an invalid null handling policy was advertised. Strengthened null requirements for types that expose null-instances.

Encapsulate KeyspaceIdentifier and CqlIdentifier with static factory methods to avoid temporary null state of fields.

Require non-null QueryOptions and provide empty option instances. Introduce methods returning non-null values (getRequired…()) for code paths known to operate on values that are available.
2017-08-02 10:17:49 +02:00
Mark Paluch
14a5f9f41b DATACASS-483 - Polishing.
Replace explicit type arguments with diamond syntax. Use Collections.empty…() instead of Collections.EMPTY_…
2017-08-02 10:17:49 +02:00
Mark Paluch
de343e2d6c DATACASS-483 - Add @FunctionalInterface to functional interfaces. 2017-08-02 10:17:48 +02:00
Oliver Gierke
ad8eb9a989 DATACASS-477 - Updated changelog. 2017-07-27 00:48:52 +02:00
Oliver Gierke
9711a45d98 DATACASS-478 - After release cleanups. 2017-07-25 16:10:38 +02:00
Oliver Gierke
044adb0635 DATACASS-478 - Prepare next development iteration. 2017-07-25 16:10:33 +02:00
Oliver Gierke
0918075327 DATACASS-478 - Release version 2.0 RC2 (Kay). 2017-07-25 15:34:23 +02:00
Oliver Gierke
9800c953e5 DATACASS-478 - Prepare 2.0 RC2 (Kay). 2017-07-25 15:33:32 +02:00