use of org.hibernate.type.descriptor.jdbc.BlobJdbcType in project hibernate-orm by hibernate.
the class OracleDialect method contributeTypes.
@Override
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
super.contributeTypes(typeContributions, serviceRegistry);
if (getVersion().isSameOrAfter(12)) {
// account for Oracle's deprecated support for LONGVARBINARY
// prefer BLOB, unless the user explicitly opts out
boolean preferLong = serviceRegistry.getService(ConfigurationService.class).getSetting(PREFER_LONG_RAW, StandardConverters.BOOLEAN, false);
BlobJdbcType descriptor = preferLong ? BlobJdbcType.PRIMITIVE_ARRAY_BINDING : BlobJdbcType.DEFAULT;
typeContributions.contributeJdbcType(descriptor);
}
// Oracle requires a custom binder for binding untyped nulls with the NULL type
typeContributions.contributeJdbcType(NullJdbcType.INSTANCE);
typeContributions.contributeJdbcType(ObjectNullAsNullTypeJdbcType.INSTANCE);
// Until we remove StandardBasicTypes, we have to keep this
typeContributions.contributeType(new NullType(NullJdbcType.INSTANCE, typeContributions.getTypeConfiguration().getJavaTypeRegistry().getDescriptor(Object.class)));
typeContributions.contributeType(new JavaObjectType(ObjectNullAsNullTypeJdbcType.INSTANCE, typeContributions.getTypeConfiguration().getJavaTypeRegistry().getDescriptor(Object.class)));
}
Aggregations