Skip to content

PGobject is not considered a simple type. It was before. #1778

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

Closed
blommish opened this issue Apr 24, 2024 · 3 comments
Closed

PGobject is not considered a simple type. It was before. #1778

blommish opened this issue Apr 24, 2024 · 3 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@blommish
Copy link

blommish commented Apr 24, 2024

Converters using PGobject logs warnings

@ReadingConverter
    class PGobjectToFooConverter : Converter<PGobject, Foo?> {

        override fun convert(pGobject: PGobject): Foo? {
            return pGobject.value?.let { objectMapper.readValue<Foo>(it) }
        }
    }

Warning message:

Registering converter from class to class org.postgresql.util.PGobject as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation

It seems it was added as a Simple type and then removed in this commit. Was that intended?
879984d#diff-39643143ab2d0d7185fb6f633054e28a2804ba993e1ae9e4e7311bdcabae7190L158

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 24, 2024
@schauder
Copy link
Contributor

It was only removed for R2DBC since the PG* types are part of the JDBC driver and therefore not present for R2DBC.

Please provide a Minimimal Reproducable Example, preferable as a Github repository. Make sure to include the database, either as an in memory database or if that is not possible using Testcontainers.

@schauder schauder self-assigned this Apr 24, 2024
@schauder schauder added the status: waiting-for-feedback We need additional information before we can continue label Apr 24, 2024
@blommish
Copy link
Author

@schauder
https://github.com/blommish/spring-data-jdbc-test/blob/main/src/test/kotlin/no/blommish/BarRepositoryTest.kt#L42

2024-04-25T11:45:23.335+02:00 WARN 71844 --- [ Test worker] o.s.data.convert.CustomConversions : Registering converter from class org.postgresql.util.PGobject to class no.blommish.MyJson as reading converter although it doesn't convert from a store-supported type; You might want to check your annotation setup at the converter implementation
2024-04-25T11:45:23.335+02:00 WARN 71844 --- [ Test worker] o.s.data.convert.CustomConversions : Registering converter from class no.blommish.MyJson to class org.postgresql.util.PGobject as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 25, 2024
@schauder
Copy link
Contributor

The problem is that the simpleTypes from the dialect don't get registered with the CustomConfiguration.
And this happens because you overwrite the method that does that: AbstractJdbcConfiguration.jdbcCustomConversions()

Instead overwrite userConverters().
I created a PR to that effect for your demonstrator.

@schauder schauder closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
@schauder schauder added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jun 12, 2024
stigebil added a commit to navikt/familie-ks-barnehagelister that referenced this issue Mar 7, 2025
Warning i oppstart er:
Registering converter from class to class org.postgresql.util.PGobject as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation

Løsning kommer fra diskusjon
spring-projects/spring-data-relational#1778
stigebil added a commit to navikt/familie-ks-barnehagelister that referenced this issue Mar 12, 2025
…rt (#171)

Warning i oppstart er:
Registering converter from class to class org.postgresql.util.PGobject as writing converter although it doesn't convert to a store-supported type; You might want to check your annotation setup at the converter implementation

Løsning kommer fra diskusjon
spring-projects/spring-data-relational#1778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants