Issue
How to fix this error?
No Dialect mapping for JDBC type: 2003
Here is my dialect class - child entity does not have fields, related to the error
public class CustomPostgreSQL10Dialect extends PostgreSQL10Dialect {
public CustomPostgreSQL10Dialect() {
super();
this.registerHibernateType(2003, "sql_array_type");
}
}
and single properties file
spring.jpa.database-platform=io.alphaminds.base.hibernate.dialect.CustomPostgreSQL10Dialect
spring.jpa.hibernate.dialect=io.alphaminds.base.hibernate.dialect.CustomPostgreSQL10Dialect
Spring 2.5.2
And my entity
@TypeDef(
name = "enum-array",
typeClass = EnumArrayType.class
)
@FieldDefaults(level = AccessLevel.PRIVATE)
public abstract class Contact extends AuditedEntity {
//...
@Type(type = "enum-array", parameters = @org.hibernate.annotations.Parameter(
name = "sql_array_type", value = "messengers"))
MessengerType[] messengers;
}
Solution
You would need to register the SQL type by calling registerColumnType
in the Dialect
, although I don't think this is what you really want, as that would use a single SQL type for all enum arrays. You should provide the SQL type at the use-site through @Column(columnDefinition = "int[]")
Answered By - Christian Beikov