You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're experimenting with the new DataClassRowMapper and found that if logging is set to DEBUG level then the No property found for column debug message is output.
This is confusing as it suggests that the column / property isn't being mapped, which isn't true as it is mapped during the constructor injection instead.
Steps to reproduce:
Change spring logging to be debug in the test log file.
Run one of the tests - ./gradlew spring-jdbc:test --tests org.springframework.jdbc.core.KotlinDataClassRowMapperTests
View the standard output from the test in spring-jdbc/build/reports/tests/test/classes/org.springframework.jdbc.core.KotlinDataClassRowMapperTests.html
e.g.
08:37:03.946 [Test worker] DEBUG o.s.j.c.JdbcTemplate - Executing SQL query [select name, age, birth_date, balance from people]
08:37:03.953 [Test worker] DEBUG o.s.j.d.DataSourceUtils - Fetching JDBC Connection from DataSource
08:37:03.973 [Test worker] DEBUG o.s.j.c.DataClassRowMapper - No property found for column 'name' mapped to field 'name'
08:37:03.973 [Test worker] DEBUG o.s.j.c.DataClassRowMapper - No property found for column 'age' mapped to field 'age'
08:37:03.974 [Test worker] DEBUG o.s.j.c.DataClassRowMapper - No property found for column 'birth_date' mapped to field 'birth_date'
08:37:03.974 [Test worker] DEBUG o.s.j.c.DataClassRowMapper - No property found for column 'balance' mapped to field 'balance'
08:37:03.975 [Test worker] DEBUG o.s.j.c.DataClassRowMapper - No property found for column 'e_mail' mapped to field 'e_mail'
The message should only be output if no property has been found / mapped.
In this case DataClassRowMapper deliberately suppresses the properties. One solution would be to keep a set of suppressed properties and then only output the message if not in the set.
Note that the log message is only output if logging is set to DEBUG, so it isn't a high severity issue.
The text was updated successfully, but these errors were encountered:
sbrannen
changed the title
Using DataClassRowMapper causes No property found for column debug messages in logs
Using DataClassRowMapper causes "No property found for column" debug messages in logs
Mar 15, 2022
From my perspective, we could simply drop that debug log statement (or potentially downgrade it to trace level but I'd rather drop it right away). It was only really meant to help with setter method mismatches in the original bean property mapper, but given the flexible mapping strategies in a modern-day data class arrangement, such a log is indeed more confusing than helpful.
Spring JDBC: 5.3.16
Spring Boot 2.6.4
We're experimenting with the new
DataClassRowMapper
and found that if logging is set toDEBUG
level then the No property found for column debug message is output.This is confusing as it suggests that the column / property isn't being mapped, which isn't true as it is mapped during the constructor injection instead.
Steps to reproduce:
debug
in the test log file../gradlew spring-jdbc:test --tests org.springframework.jdbc.core.KotlinDataClassRowMapperTests
e.g.
The message should only be output if no property has been found / mapped.
In this case DataClassRowMapper deliberately suppresses the properties. One solution would be to keep a set of suppressed properties and then only output the message if not in the set.
Note that the log message is only output if logging is set to
DEBUG
, so it isn't a high severity issue.The text was updated successfully, but these errors were encountered: