It seems that HibernatePropertiesCustomizer does not apply.

I think I do everything right, because my customizer was properly recognized and stored in the customizer collection to be applied. But it never happened. A kind of proof is that it even hits the very org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration which attempts to set a customizer to inject org.hibernate.resource.beans.container.spi.BeanContainer property to connect Spring context to Hibernate.

As the result, it is not possible to use Spring Beans, e.g., for converters like this:

@Component
@Converter
class FooAttributeConverter(private val mapper: ObjectMapper) : AttributeConverter<Foo, String> {
    override fun convertToDatabaseColumn(attribute: Foo?): String? = attribute?.let(mapper::writeValueAsString)
    override fun convertToEntityAttribute(data: String?): T? = data?.let { mapper.readValue(it, Foo:class.java) }
}

// Stripped down, keeping the interesting part
@Entity
class FooEntity(
    @Column
    @JdbcTypeCode(SqlTypes.JSON)
    @Convert(converter = FooAttributeConverter::class)
    var foo: Foo,
)

Well, so the result of this problem is another issue — actually the one that mattered to me at the moment.

I'm bound at this moment to Spring Boot 3.3.12, so this was what I tried.

Comment From: wilkinsona

We have a test that verifies that the properties customizers are applied and in the correct order. From what you have described, I cannot tell why that's not working for you.

OSS support for Spring Boot 3.3.x has ended. Please upgrade to 3.4.x or later. If the problem you are seeing still occurs and you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.