Skip to content
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

Annotation column has no effect in Kotlin data classes [DATACASS-799] #966

Closed
spring-projects-issues opened this issue Sep 3, 2020 · 2 comments
Assignees
Labels
in: core in: kotlin in: mapping in: repository status: declined type: bug

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Sep 3, 2020

Abhijit Sarkar opened DATACASS-799 and commented

@Table("get_responses")
data class Response(
    @PrimaryKey
    @Column("session_id")
    val sessionId: String,
    val text: String,
    val type: String?
)

The column sessionId gets created as sessionid. In fact, the annotation column has no effect; @Column("abc") creates the column sessionid.

Using this with Kotlin coroutine support (CoroutineCrudRepository).

From cqlsh:

desc ks.get_responses;

CREATE TABLE ks.get_responses (
    sessionid text PRIMARY KEY,
    text text,
    type text
)

Affects: 3.0.3 (Neumann SR3)

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Sep 3, 2020

Mark Paluch commented

@Column has no effect in combination with @PrimaryKey as the @PrimaryKey annotation controls the column name

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Sep 3, 2020

Abhijit Sarkar commented

Mark Paluch Perhaps a warning in the logs will save a lot of future hassle, also save time of unsuspecting users and yours

@spring-projects-issues spring-projects-issues added type: bug status: declined in: repository in: kotlin in: core in: mapping labels Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core in: kotlin in: mapping in: repository status: declined type: bug
Projects
None yet
Development

No branches or pull requests

2 participants