Commit Graph

1317 Commits

Author SHA1 Message Date
Mark Paluch
b2e192df25 DATACASS-733 - Updated changelog. 2020-04-28 11:59:00 +02:00
Mark Paluch
d84cdac192 DATACASS-387 - Remove deprecated API.
Removal of default bean registration in the namespace support. Remove deprecated methods and constructors. Adapt tests. Upgrade migration guide.
2020-04-23 10:55:14 +02:00
Mark Paluch
9e8385297c DATACASS-753 - Deferred Session retrieval from ReactiveSessionFactory.
ReactiveSessionFactory.getSession() now returns a Mono that allows for accessing the Reactor Context while session retrieval.
2020-04-23 10:43:10 +02:00
Mark Paluch
719e22154a DATACASS-167 - Polishing.
Reformat docs.
2020-04-06 10:03:00 +02:00
Mark Paluch
ba7b725202 DATACASS-167 - Polishing.
Add value shortcut to Embedded.Nullable and Embedded.Empty for improved annotation usage. Move isEntity check into PersistentProperty.isEmbedded as both checks are issued always together.

Tweak documentation.

Original pull request: #173.
2020-04-06 09:58:37 +02:00
Christoph Strobl
a59d012fb9 DATACASS-167 - Add support for embedded entities.
Embedded entities are used to design value objects in your Java domain model whose properties are flattened out into the table.
In the following example you see, that User.name is annotated with Embedded.
The consequence of this is that all properties of `UserName` are folded into the `user` table which consists of 3 columns (user_id, firstname, lastname).

Embedded entities may only contain simple property types. It is not possible to nest an embedded entity into another embedded one.

However, if the firstname and lastname column values are actually null within the result set, the entire property name will be set to null according to the onEmpty of Embedded, which nulls objects when all nested properties are null.

Opposite to this behaviour USE_EMPTY tries to create a new instance using either a default constructor or one that accepts nullable parameter values from the result set.

public class User {

    @PrimaryKey("user_id")
    private String userId;

    @Embedded(onEmpty = USE_NULL)
    UserName name;
}

public class UserName {
    private String firstname;
    private String lastname;
}

Original pull request: #173.
2020-04-06 09:57:57 +02:00
Mark Paluch
b2031724ff DATACASS-465 - Polishing.
Remove FrozenIndicator from public API. Refactor to recursive type to reflect property type declaration nature. Rename to FrozenIndicator. Update documentation.

Original pull request: #172.
2020-04-06 09:11:44 +02:00
Jens Schauder
17adf20a14 DATACASS-465 - Introduces @Frozen annotation to mark schema elements as Frozen.
`@Frozen` is supported on UDTs, collection like properties (`Set`, `List` and `Map`), and their type parameters if those are UDTs.

For example

    @Frozen Map<String, @Frozen MyUdt> propertyName;

Original pull request: #172.
2020-04-06 09:11:26 +02:00
Mark Paluch
2b05a68eea DATACASS-737 - After release cleanups. 2020-03-31 15:08:05 +02:00
Mark Paluch
e1162b5af3 DATACASS-737 - Prepare next development iteration. 2020-03-31 15:08:04 +02:00
Mark Paluch
16667371ef DATACASS-737 - Release version 3.0 RC1 (Neumann). 2020-03-31 14:59:41 +02:00
Mark Paluch
30193d23a4 DATACASS-737 - Prepare 3.0 RC1 (Neumann). 2020-03-31 14:59:20 +02:00
Mark Paluch
aa80459e05 DATACASS-737 - Updated changelog. 2020-03-31 14:59:13 +02:00
Mark Paluch
d2998c8dfe DATACASS-748 - Upgrade to Cassandra driver 4.5.1. 2020-03-31 14:41:07 +02:00
John Blum
949b798dbf DATACASS-84 - Polish.
Resolves gh-171.
2020-03-30 19:05:50 -07:00
Mark Paluch
290d271f4f DATACASS-84 - Use NamingStrategy for table and column name derivation.
We now use a configurable NamingStrategy to configure how table, user-defined type and column names are derived if the name is not expicitly configured. The default naming strategy uses the type/property name. Naming strategies allow customization with a transformation function (all lower-case/upper case, prepending/appending and more) and strategies can be provided by a custom implementation.
2020-03-30 19:00:50 -07:00
Mark Paluch
c9978f7a72 DATACASS-747 - Add test to verify quoting of field names. 2020-03-30 10:14:25 +02:00
Mark Paluch
0a59375479 DATACASS-734 - Updated changelog. 2020-03-25 10:59:46 +01:00
Mark Paluch
ee9b8d6c2b DATACASS-470 - Polishing.
Require CassandraCustomConversions type when wiring CassandraMappingContext.
2020-03-24 13:53:34 +01:00
Mark Paluch
64d46da6a4 DATACASS-470 - Move Cassandra type resolution into MappingCassandraConverter.
All DataType-resolution functionality is now encapsulated in ColumnTypeResolver and all DataType-related methods (getDataType(), getTupleType(), getUserType()) were migrated into ColumnTypeResolver. DataType resolution requires always a converter context to apply registered converters so this concern cannot be handled entirely on the mapping level.

Related to type resolution also schema object derivation (create table/index/user type) functionality was moved from CassandraMappingContext into SchemaFactory as schema object derivation requires the converter registrations.
2020-03-23 15:20:44 +01:00
Mark Paluch
5b0e3f0c56 DATACASS-743 - Introduce ColumnTypeResolver.
We now resolve column types by using ColumnTypeResolver that encapsulates type lookups that previously were spread across different areas of the converter. We consistently apply type resolution for singular properties and collection/Map-like properties.
2020-03-23 10:58:37 +01:00
Mark Paluch
f2b806052c DATACASS-741 - Polishing.
Reflect impact of transient property usage in persistence constructor.
2020-03-19 15:21:12 +01:00
Mark Paluch
54f2d278a4 DATACASS-741 - Add support for @Value.
The `@Value` annotation can now be used on constructor parameters to evaluate expressions to obtain constructor values. The root object refers to a Row, UdtValue or TupleValue depending from which source the object gets materialized.

class WithValue {
    final @Id String id;
    final @Transient String firstname;

    public WithValue(String id, @Value("#root.getString(1)") String firstname) {
        this.id = id;
        this.firstname = firstname;
    }
}
2020-03-19 15:15:13 +01:00
Mark Paluch
2a20fb8aa1 DATACASS-739 - Include custom conversions documentation from Commons. 2020-03-17 10:41:21 +01:00
Jens Schauder
d46824ff0d DATACASS-729 - After release cleanups. 2020-03-11 09:57:42 +01:00
Jens Schauder
ef1e5fb9ce DATACASS-729 - Prepare next development iteration. 2020-03-11 09:57:41 +01:00
Jens Schauder
626c5fc991 DATACASS-729 - Release version 3.0 M4 (Neumann). 2020-03-11 09:47:07 +01:00
Jens Schauder
963f92ff88 DATACASS-729 - Prepare 3.0 M4 (Neumann). 2020-03-11 09:46:29 +01:00
Jens Schauder
45fd1b5f9c DATACASS-729 - Updated changelog. 2020-03-11 09:46:20 +01:00
Mark Paluch
a6dabe9754 DATACASS-538 - Polishing.
Remove tests for methods that do not exist.
2020-03-10 10:41:58 +01:00
Mark Paluch
1a2f999e60 DATACASS-712 - Polishing.
Reformat code.
2020-03-10 10:05:43 +01:00
Mark Paluch
699e4ca168 DATACASS-712 - Adapt to query builder API for set at list index. 2020-03-10 10:05:21 +01:00
Mark Paluch
238eb5f771 DATACASS-736 - Polishing.
Deprecate CassandraReadTimeoutException.getWasDataReceived() and introduce wasDataPresent to align with ReadTimeoutException.
2020-03-10 09:58:03 +01:00
Mark Paluch
6fee29acb3 DATACASS-736 - Upgrade to Cassandra driver 4.5.0. 2020-03-10 09:50:56 +01:00
Mark Paluch
3dcdd78bf9 DATACASS-735 - Fix integer overflow in Update.increment/decrement.
We now avoid integer downcasting for increment/decrement operations and use the long value instead.
2020-03-02 09:30:29 +01:00
Mark Paluch
d38dbf049e DATACASS-716 - Updated changelog. 2020-02-26 11:55:04 +01:00
Mark Paluch
cfe954b1b9 DATACASS-715 - Updated changelog. 2020-02-26 11:31:48 +01:00
Mark Paluch
19d53037d5 DATACASS-718 - Polishing.
Reformat code. Consider integer types also for decrement.

Use more concise assertion for toString().

Original pull request: #169.
2020-02-17 10:34:31 +01:00
chema
6409835432 DATACASS-718 - Fix Integer Overflow in Update.toString().
Original pull request: #169.
2020-02-17 10:34:31 +01:00
Mark Paluch
fd1d22fef5 DATACASS-719 - After release cleanups. 2020-02-12 15:04:22 +01:00
Mark Paluch
0a7dcb937e DATACASS-719 - Prepare next development iteration. 2020-02-12 15:04:21 +01:00
Mark Paluch
8ac95e2da3 DATACASS-719 - Release version 3.0 M3 (Neumann). 2020-02-12 14:47:16 +01:00
Mark Paluch
a4a58a626c DATACASS-719 - Prepare 3.0 M3 (Neumann). 2020-02-12 14:46:56 +01:00
Mark Paluch
4d70d8e6d3 DATACASS-719 - Updated changelog. 2020-02-12 14:46:49 +01:00
Mark Paluch
f00cde15e1 DATACASS-728 - Deprecate Joda-Time and ThreeTenBackport support.
Joda-Time and ThreeTenBackport converters are now deprecated in favor of JSR-310 (java.time) support. These converters are now in maintenance mode without receiving future enhancements.
2020-02-12 10:48:57 +01:00
Mark Paluch
84cd36ab18 DATACASS-722 - Add support for CqlDuration. 2020-02-07 12:48:35 +01:00
Mark Paluch
636fb14452 DATACASS-727 - Clean up converter registration.
We now no longer register duplicate converters but rather use a ConverterConfiguration to avoid JSR-310/Joda Time/ThreeTenBackport values to be converted to java.util.Date.

Remove also native time marker support as with JSR-310 usage this functionality is no longer required.
2020-02-07 12:48:35 +01:00
John Blum
c6de9dc003 DATACASS-721 - Replace incorrect use of FindBugs @NonNull and @Nullable annotations with equivalent Spring annotations. 2020-02-05 15:18:43 -08:00
John Blum
c4786458dc DATACASS-726 - Upgrade to DataStax Java Driver 4.4.
Fix broken tests.

Fix compiler warnings.

Replace incorrect use of FindBugs @NonNull and @Nullable annotations with equivalent Spring annoations.

Edit Javadoc.

Format source code.

Optimize imports.
2020-02-05 14:59:37 -08:00
John Blum
1021026943 DATACASS-725 - Upgrade to Apache Cassandra 3.11.5. 2020-02-05 09:22:11 -08:00