-
Notifications
You must be signed in to change notification settings - Fork 356
JdbcTemplate incorrectly generates an sql request #1722
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
Comments
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal yet complete sample that reproduces the problem. |
twoDemoProjects.zip |
It was necessary to create a foreign key with the same name as the table. Apparently, in the old version, it was specified by the name of the class and did not take into account the @table(name) annotation |
Introduce caching for configured RowMapper/ResultSetExtractor. We now create RowMapper/ResultSetExtractor instances only once if they are considered static configuration. A configured RowMapper ref/class is always static. A configured ResultSetExtractor ref/class is static when the extractor does not accept a RowMapper or if the RowMapper is configured. Default mappers or projection-specific ones require ResultSetExtractor recreation of the ResultSetExtractor is configured as Class. Reuse TypeInformation as much as possible to avoid Class -> TypeInformation conversion. Introduce LRU cache for DefaultAggregatePath to avoid PersistentPropertyPath lookups. Introduce best-effort quoted cache for SqlIdentifier to avoid excessive string object creation. Closes #1721 Original pull request #1722
Introduce caching for configured RowMapper/ResultSetExtractor. We now create RowMapper/ResultSetExtractor instances only once if they are considered static configuration. A configured RowMapper ref/class is always static. A configured ResultSetExtractor ref/class is static when the extractor does not accept a RowMapper or if the RowMapper is configured. Default mappers or projection-specific ones require ResultSetExtractor recreation of the ResultSetExtractor is configured as Class. Reuse TypeInformation as much as possible to avoid Class -> TypeInformation conversion. Introduce LRU cache for DefaultAggregatePath to avoid PersistentPropertyPath lookups. Introduce best-effort quoted cache for SqlIdentifier to avoid excessive string object creation. Closes #1721 Original pull request #1722
I have a project using jdbc and postgres. I have a schema.sql where the "usr" and "token" tables are created. The token table has the relationship "CONSTRAINT fk_token_user FOREIGN KEY ("user") PREFERENCES usr (id)". I switched from Spring Boot 2.7.5 to 3.1.2. When I make a findByEmail request, I get the error:
org.postgresql.util.PSQLException: ERROR: the token.usr column does not exist
Hint: Perhaps a reference to the "token.user" column was intended.
Position: 142
I have enabled the debug logs and different requests are being received:
Spring Boot 2.7.5: [SELECT "token"."issue_at" AS "issue_at", "token"."expired_at" AS "expired_at", "token"."refresh_token" AS "refresh_token" FROM "token" WHERE "token"."user" = ?]
Spring Boot 3.1.2: [SELECT "token"."issue_at" AS "issue_at", "token"."expired_at" AS "expired_at", "token"."refresh_token" AS "refresh_token" FROM "token" WHERE "token"."usr" = ?]
The text was updated successfully, but these errors were encountered: