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

The following examples show how to use org.hibernate.type.descriptor.sql.BlobTypeDescriptor. These examples are extracted from open source projects. 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 Project: lams   Source File: PostgreSQL81Dialect.java    License: 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 Project: lams   Source File: SybaseDialect.java    License: 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 Project: lams   Source File: MaterializedBlobType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public MaterializedBlobType() {
	super( BlobTypeDescriptor.DEFAULT, PrimitiveByteArrayTypeDescriptor.INSTANCE );
}
 
Example 4
public WrappedMaterializedBlobType() {
	super( BlobTypeDescriptor.DEFAULT, ByteArrayTypeDescriptor.INSTANCE );
}
 
Example 5
Source Project: lams   Source File: SerializableToBlobType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public SerializableToBlobType() {
	super( BlobTypeDescriptor.DEFAULT, new SerializableTypeDescriptor( Serializable.class ) );
}
 
Example 6
Source Project: jhipster   Source File: FixedPostgreSQL10DialectTest.java    License: 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 Project: jhipster   Source File: FixedPostgreSQL82DialectTest.java    License: 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 Project: jhipster   Source File: FixedPostgreSQL95DialectTest.java    License: 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 Project: cosmo   Source File: BufferedContentBlob.java    License: 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);
}