- Notifications
You must be signed in to change notification settings - Fork 310
DATACASS-172 - Support for UDTs. #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reminder: Is there a better approach than registering an |
Hi can some one please let me know when this feature will be merged to release branch? |
@shoaib627 Here's a link to the Ingalls Release Train containing all dates. It would be amazing getting feedback on that feature. The currently only way how to get this dependency is checking out my repo and the branch and building the project ( <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-cql</artifactId> <version>1.5.0.DATACASS-172-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-cassandra</artifactId> <version>1.5.0.DATACASS-172-SNAPSHOT</version> </dependency> |
@olivergierke maybe you want to take a look on this one? |
Prepare issue branch.
Add tests. Add validations to Cql generators. Enhance JavaDoc. Create FieldSpecification for UDT fields.
We now support Cassandra User-defined types. UDTs can be created using CQL generators and used inside of mapped domain classes. User-defined types can be used either raw as UDTValue that is passed through or as mapped object. Mapped UDTs must be annotated with @UserDefinedType. Types are included into schema generation so known and defined UDTs are created before any tables are created. UDTs can be used with set and list collection types and in primary keys. UDTs can also be used in repository query methods as query predicates. Updating UDTs will update the whole UDT. @UserDefinedType public class Address { String city; String country; } @table public class Person { @id String id; Address address; UDTValue genericUdt; } The XML namespace support was extended with new schema versions to support provide a User Type resolver so UDTs can be resolved: <cassandra:mapping> <cassandra:user-type-resolver keyspace-name="${cassandra.keyspace}" /> </cassandra:mapping>
Leave schema files as they were with Spring Data Cassandra 1.4 and continue efforts with newly introduced Spring Data Cassandra 1.5 XSD files.
Hey, I'm quite new to spring data in general, so may be my question is quite obvious, but... I'am trying to understand how to use the UDTs - but I couldn't figure out how to "register" a UDT - so that it can be resolved by the mapping context. There are two variants:
I implemented the UDT as a class with @UserDefinedType annotation - and thought it should be usable without the @CassandraType annotation... When I execute my test, the following error occurs: Best regards, Alex |
@warwing care to post your question on StackOverflow? This is not a general discussion forum. |
We now support Cassandra User-defined types. UDTs can be created using CQL generators and used inside of mapped domain classes. User-defined types can be used either raw as
UDTValue
that is passed through or as mapped object. Mapped UDTs must be annotated with@UserDefinedType
. Types are included into schema generation so known and defined UDTs are created before any tables are created. UDTs can be used with set and list collection types and in primary keys. UDTs can also be used in repository query methods as query predicates.Updating UDTs will update the whole UDT.
Related ticket: DATACASS-172
Depends on: #83