spring-projects / spring-data-cassandra

Provides support to increase developer productivity in Java when using Apache Cassandra. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-cassandra/
Apache License 2.0
374 stars 307 forks source link

Do not require @Table annotation [DATACASS-360] #529

Closed spring-projects-issues closed 6 years ago

spring-projects-issues commented 7 years ago

Mark Paluch opened DATACASS-360 and commented

Spring Data Cassandra strictly requires @Table on entities. BasicCassandraMappingContext distinguishes by @Table what entities should be treated as table entities and which ones should be user-defined types/primary keys. This distinction is only required for two uses:

  1. Table creation
  2. Table truncation within tests

Both cases are valid but @Table is not necessarily required for all persistent entities. Entities without @Table can be still mapped in both directions. A class annotated with @Table will participate in schema management and be exposed as a table entity. Classes used as entities without @Table can be still used to query Cassandra but schema management will not create any tables for these classes


Affects: 1.5 M1 (Ingalls), 2.0 M1 (Kay)

Issue Links:

Referenced from: pull request https://github.com/spring-projects/spring-data-cassandra/pull/91

Backported to: 1.5 RC1 (Ingalls)

spring-projects-issues commented 7 years ago

John Blum commented

Reviewed and merged to both master for SD Cassandra 1.5 RC1 (Ingalls) and 2.0.x for SD Cassandra 2.0 M2 (Kay)