Skip to content

Mixed case table names are not supported without using deprecated annotation property #1263

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

Closed
ykozarovitsky-quotient opened this issue May 7, 2022 · 2 comments
Assignees
Labels
type: bug A general bug

Comments

@ykozarovitsky-quotient
Copy link

I have a Cassandra database that uses mixed case table names. E.g. User, Partner. When queries are created from the spring application, the table names are lowercased (user, partner). Cassandra complains that the tables do not exist.

In the Table annotation there is a deprecated property forceQuote. When I set this property as true, the table names are used as they are and surrounded by the quotes. Everything works fine. As I understand the forceQuote was used to double quote reserved names. I am not using reserved names. Why are they lowercased?

I believe this is done in the org.springframework.data.cassandra.core.mapping.IdentifierFactory.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 7, 2022
@mp911de
Copy link
Member

mp911de commented Jul 5, 2022

This is indeed unfortunate, especially there's no mechanism to preserve letter casing except for setting table/column names yourself through CassandraPersistentEntity.setTableName(…)/CassandraPersistentProperty.setColumnName(…). We need to revisit the name derivation to actually preserve letter casing when providing a name and not break existing applications when they use name derivation.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 5, 2022
@mp911de mp911de self-assigned this Jul 5, 2022
@mp911de mp911de added type: bug A general bug and removed type: enhancement A general enhancement labels Jul 5, 2022
@mp911de mp911de changed the title Mixed case table names are not supported without using deprecated annotation property. Mixed case table names are not supported without using deprecated annotation property Jul 5, 2022
@mp911de
Copy link
Member

mp911de commented Jul 5, 2022

Reclassifying this as bug, because a table name @Table("\"IAmQuoted\"") is being rendered as """IAmQuoted""" instead of "IAmQuoted".

@mp911de mp911de added this to the 3.3.6 (2021.1.6) milestone Jul 5, 2022
@mp911de mp911de closed this as completed in c120e8f Jul 5, 2022
mp911de added a commit that referenced this issue Jul 5, 2022
We revised the table and column name generation by unifying the generation code into CqlIdentifierGenerator. We also properly distinguish between generated names that are generated and those provided by the application (i.e. through annotations).

Closes #1263
mp911de added a commit that referenced this issue Jul 5, 2022
We revised the table and column name generation by unifying the generation code into CqlIdentifierGenerator. We also properly distinguish between generated names that are generated and those provided by the application (i.e. through annotations).

Closes #1263
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants