SQL Type descriptor, which one is better

Hi all,

in our project we define some SQL types using @Typedefs annotation,
this is an example:
@TypeDef(name = “PGpoint”,
typeClass = PointType.class),
@TypeDef(name = “Integer[]”,
typeClass = IntArrayType.class),
@TypeDef(name = “String[]”,
typeClass = StringArrayType.class),
@TypeDef(name = “Double[]”,
typeClass = DoubleArrayType.class),
@TypeDef(name = “Boolean[]”,
typeClass = BooleanArrayType.class),
@TypeDef(name = “Enum”,
typeClass = EnumType.class)})

For a strange reason, using native SQL query (postgreSQL 11) we have an error for a custom type
org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111

The problem has been solved by extending PostgreSQL95Dialect in this way

public class PostgreSQLMyDialect extends PostgreSQL95Dialect { public PostgreSQLMyDialect() { super(); this.registerHibernateType( Types.OTHER, FieldValueType.class.getName() ); } }

We do NOT have the mapping error when using Hibernate queries on same field.

Is there a unique way (or the best one) to map our custom types?