HHH-6972 Support PostgreSQL and Oracle LOBs

This commit is contained in:
brmeyer 2012-09-26 17:33:54 -04:00
parent 59453919c7
commit 0fbf7202c0
1 changed files with 27 additions and 0 deletions

View File

@ -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";
}