Search in sources :

Example 1 with ClobImplementer

use of org.hibernate.engine.jdbc.ClobImplementer in project hibernate-orm by hibernate.

the class LobCreatorTest method testLobCreation.

private void testLobCreation(LobCreator lobCreator) throws SQLException {
    Blob blob = lobCreator.createBlob(new byte[] {});
    if (lobCreator == NonContextualLobCreator.INSTANCE) {
        assertTrue(blob instanceof BlobImplementer);
    } else {
        assertTrue(blob instanceof JdbcBlob);
    }
    blob = lobCreator.wrap(blob);
    assertTrue(blob instanceof WrappedBlob);
    Clob clob = lobCreator.createClob("Hi");
    if (lobCreator == NonContextualLobCreator.INSTANCE) {
        assertTrue(clob instanceof ClobImplementer);
    } else {
        assertTrue(clob instanceof JdbcClob);
    }
    clob = lobCreator.wrap(clob);
    assertTrue(clob instanceof WrappedClob);
    Clob nclob = lobCreator.createNClob("Hi");
    if (lobCreator == NonContextualLobCreator.INSTANCE) {
        assertTrue(nclob instanceof NClobImplementer);
    } else {
        assertTrue(nclob instanceof JdbcNClob);
    }
    assertTrue(NClob.class.isInstance(nclob));
    nclob = lobCreator.wrap(nclob);
    assertTrue(nclob instanceof WrappedClob);
    blob.free();
    clob.free();
    nclob.free();
}
Also used : WrappedBlob(org.hibernate.engine.jdbc.WrappedBlob) NClob(java.sql.NClob) WrappedBlob(org.hibernate.engine.jdbc.WrappedBlob) Blob(java.sql.Blob) WrappedClob(org.hibernate.engine.jdbc.WrappedClob) NClobImplementer(org.hibernate.engine.jdbc.NClobImplementer) BlobImplementer(org.hibernate.engine.jdbc.BlobImplementer) ClobImplementer(org.hibernate.engine.jdbc.ClobImplementer) NClobImplementer(org.hibernate.engine.jdbc.NClobImplementer) WrappedClob(org.hibernate.engine.jdbc.WrappedClob) NClob(java.sql.NClob) Clob(java.sql.Clob)

Aggregations

Blob (java.sql.Blob)1 Clob (java.sql.Clob)1 NClob (java.sql.NClob)1 BlobImplementer (org.hibernate.engine.jdbc.BlobImplementer)1 ClobImplementer (org.hibernate.engine.jdbc.ClobImplementer)1 NClobImplementer (org.hibernate.engine.jdbc.NClobImplementer)1 WrappedBlob (org.hibernate.engine.jdbc.WrappedBlob)1 WrappedClob (org.hibernate.engine.jdbc.WrappedClob)1