Add instructions if object is not deserialized into the right type

Closes gh-3009
This commit is contained in:
Marcus Hert Da Coregio
2024-06-04 15:47:54 -03:00
parent 8862df484b
commit d5daa283f7
2 changed files with 18 additions and 2 deletions

View File

@@ -26,11 +26,21 @@ public class SessionConfig implements BeanClassLoaderAware {
VALUES (?, ?, encode(?, 'escape')::jsonb)
""";
private static final String UPDATE_SESSION_ATTRIBUTE_QUERY = """
UPDATE %TABLE_NAME%_ATTRIBUTES
SET ATTRIBUTE_BYTES = encode(?, 'escape')::jsonb
WHERE SESSION_PRIMARY_ID = ?
AND ATTRIBUTE_NAME = ?
""";
private ClassLoader classLoader;
@Bean
SessionRepositoryCustomizer<JdbcIndexedSessionRepository> customizer() {
return (sessionRepository) -> sessionRepository.setCreateSessionAttributeQuery(CREATE_SESSION_ATTRIBUTE_QUERY);
return (sessionRepository) -> {
sessionRepository.setCreateSessionAttributeQuery(CREATE_SESSION_ATTRIBUTE_QUERY);
sessionRepository.setUpdateSessionAttributeQuery(UPDATE_SESSION_ATTRIBUTE_QUERY);
};
}
@Bean("springSessionConversionService")