Edited:
I also tested in the version 2.6.4
and still happens
I just upgraded spring-boot from 2.5.7
to 2.6.1
and I notice a change of behavior in a specific query. I'm trying to load only a specific column in a query, and when it's value in DB is null, it is throwing the Couldn't find PersistentEntity for type class java.lang.String!
Exception.
This is my code in the Repository,
@Query("SELECT my_column " +
" FROM mytable " +
" WHERE another_column = :secColumn " +
" AND third_column = :thirdColumn")
Optional<String> getMyColumn(@Param("secColumn") String secColumn,
@Param("thirdColumn") String thirdColumn);
}
Observations:
It works fine if the column it DB is not null
It was working fine with a null value in DB for version
2.5.7
If I return the whole entity inside the Optional, it works as expected