org.hibernate.type.descriptor.sql.BlobTypeDescriptor Java Examples

The following examples show how to use org.hibernate.type.descriptor.sql.BlobTypeDescriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PostgreSQL81Dialect.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example #2
Source File: SybaseDialect.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	switch (sqlCode) {
	case Types.BLOB:
		return BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING;
	case Types.CLOB:
		// Some Sybase drivers cannot support getClob.  See HHH-7889
		return ClobTypeDescriptor.STREAM_BINDING_EXTRACTING;
	default:
		return super.getSqlTypeDescriptorOverride( sqlCode );
	}
}
 
Example #3
Source File: MaterializedBlobType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public MaterializedBlobType() {
	super( BlobTypeDescriptor.DEFAULT, PrimitiveByteArrayTypeDescriptor.INSTANCE );
}
 
Example #4
Source File: WrappedMaterializedBlobType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public WrappedMaterializedBlobType() {
	super( BlobTypeDescriptor.DEFAULT, ByteArrayTypeDescriptor.INSTANCE );
}
 
Example #5
Source File: SerializableToBlobType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public SerializableToBlobType() {
	super( BlobTypeDescriptor.DEFAULT, new SerializableTypeDescriptor( Serializable.class ) );
}
 
Example #6
Source File: FixedPostgreSQL10DialectTest.java    From jhipster with Apache License 2.0 4 votes vote down vote up
@Test
public void testBlobTypeRemap() {
    SqlTypeDescriptor descriptor = dialect.remapSqlTypeDescriptor(BlobTypeDescriptor.DEFAULT);
    assertThat(descriptor).isEqualTo(BinaryTypeDescriptor.INSTANCE);
}
 
Example #7
Source File: FixedPostgreSQL82DialectTest.java    From jhipster with Apache License 2.0 4 votes vote down vote up
@Test
public void testBlobTypeRemap() {
    SqlTypeDescriptor descriptor = dialect.remapSqlTypeDescriptor(BlobTypeDescriptor.DEFAULT);
    assertThat(descriptor).isEqualTo(BinaryTypeDescriptor.INSTANCE);
}
 
Example #8
Source File: FixedPostgreSQL95DialectTest.java    From jhipster with Apache License 2.0 4 votes vote down vote up
@Test
public void testBlobTypeRemap() {
    SqlTypeDescriptor descriptor = dialect.remapSqlTypeDescriptor(BlobTypeDescriptor.DEFAULT);
    assertThat(descriptor).isEqualTo(BinaryTypeDescriptor.INSTANCE);
}
 
Example #9
Source File: BufferedContentBlob.java    From cosmo with Apache License 2.0 2 votes vote down vote up
/**
 * Constructor used by Hibernate: fetches config-time LobHandler and
 * config-time JTA TransactionManager from LocalSessionFactoryBean.
 *
 */
public BufferedContentBlob() {
    super(BlobTypeDescriptor.STREAM_BINDING, BufferedContentTypeDescriptor.INSTANCE);
}