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

column name escaping not working with default findAll method #193

Closed
cambierr opened this issue Sep 24, 2019 · 3 comments
Closed

column name escaping not working with default findAll method #193

cambierr opened this issue Sep 24, 2019 · 3 comments
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@cambierr
Copy link

Given a model class containing:

    @Column(value = "end")
    private long end;

the default findAll method doesn't work since it doesn't escape the column whose name is end.

If escaping the name in the column like so:

    @Column(value = "\"end\"")
    private long end;

Then the mapper can't convert the rows to entities anymore.

For now, the only obvious fix seems to redefine the findAll method in the repository interface with something like @query("select * from myEntity")

@mp911de
Copy link
Member

mp911de commented Sep 24, 2019

Paging @schauder. How do we want to go about this? Do we want to introduce more dialect-awareness in Spring Data Relational or do we want to quote all columns regardless of the need for quoting?

@mp911de mp911de added the type: enhancement A general enhancement label Sep 24, 2019
@mp911de mp911de added the status: duplicate A duplicate of another issue label Feb 18, 2020
@mp911de
Copy link
Member

mp911de commented Feb 18, 2020

We introduced escaping/quoting support with #291. Quotation is disabled by default. You can enable it via R2dbcMappingContext.setForceQuote(…) for all entities.

Note that quotation can come with case-sensitivity on certain databases.

@mp911de mp911de closed this as completed Feb 18, 2020
@igchuk
Copy link

igchuk commented Jan 5, 2021

@mp911de setForceQuote fixed saving, but broke reading for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants