Skip to content

ArrayType causes org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column found (Types#ARRAY), but expecting (Types#OTHER) with Hibernate 6.3 and 6.4 #697

@Novalaina

Description

@Novalaina

Describe the bug
When I upgrade from

hypersistence-utils-hibernate-62:3.7.1
to
hypersistence-utils-hibernate-63:3.7.1

The following code:

@Type(
     value = ListArrayType::class,
     parameters = [Parameter(
         value = "house",
         name = ListArrayType.SQL_ARRAY_TYPE,
     )]
 )
 @Column(columnDefinition = "house[]")
 val houses: List<House>,

Throws this error:

org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [houses] in table [dok_card]; found [_house (Types#ARRAY)], but expecting [house[] (Types#OTHER)]

My hibernate version is 6.4.1.Final.

To Reproduce

Follow the instructions here: https://vladmihalcea.com/postgresql-array-java-list/ with the latest version of hibernate and hypersistence-utils.

Expected behavior
No error is thrown when using a postgresql array of enums with a java list.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions