HHH-6972 Support PostgreSQL and Oracle LOBs
This commit is contained in:
parent
068c973cde
commit
8dbaefced4
|
@ -155,6 +155,33 @@ public class PostgreSQL81Dialect extends Dialect {
|
|||
getDefaultProperties().setProperty( Environment.NON_CONTEXTUAL_LOB_CREATION, "true" );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
|
||||
SqlTypeDescriptor descriptor;
|
||||
switch ( sqlCode ) {
|
||||
case Types.BLOB: {
|
||||
// Force BLOB binding. Otherwise, byte[] fields annotated
|
||||
// with @Lob will attempt to use
|
||||
// BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING. Since the
|
||||
// dialect uses oid for Blobs, byte arrays cannot be used.
|
||||
descriptor = BlobTypeDescriptor.BLOB_BINDING;
|
||||
break;
|
||||
}
|
||||
case Types.CLOB: {
|
||||
descriptor = ClobTypeDescriptor.CLOB_BINDING;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
descriptor = super.getSqlTypeDescriptorOverride( sqlCode );
|
||||
break;
|
||||
}
|
||||
}
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
public String getAddColumnString() {
|
||||
return "add column";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue