public boolean isMatch(Dialect dialect) { return dialect.useInputStreamToInsertBlob(); } }
/** * Returns the {@link SqlTypeDescriptor} that should be used to handle the given JDBC type code. Returns * {@code null} if there is no override. * * @param sqlCode A {@link Types} constant indicating the SQL column type * @return The {@link SqlTypeDescriptor} to use as an override, or {@code null} if there is no override. */ protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { SqlTypeDescriptor descriptor; switch ( sqlCode ) { case Types.CLOB: { descriptor = useInputStreamToInsertBlob() ? ClobTypeDescriptor.STREAM_BINDING : null; break; } default: { descriptor = null; break; } } return descriptor; }
@Override public boolean useStreamForLobBinding() { if ( useStreamForLobBinding == null ) { useStreamForLobBinding = Environment.useStreamsForBinary() || getJdbcServices().getJdbcEnvironment().getDialect().useInputStreamToInsertBlob(); } return useStreamForLobBinding; }
protected void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value == null ) { st.setNull( index, sqlTypes( null )[0] ); } else { byte[] toSet = unWrap( value ); final boolean useInputStream = session.getFactory().getDialect().useInputStreamToInsertBlob(); if ( useInputStream ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, Hibernate.getLobCreator( session ).createBlob( toSet ) ); } } }
public void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value != null ) { byte[] toSet; toSet = toBytes( value ); if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, Hibernate.getLobCreator( session ).createBlob( toSet ) ); } } else { st.setNull( index, sqlTypes( null )[0] ); } }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
@Override public boolean useInputStreamToInsertBlob() { return delegate.useInputStreamToInsertBlob(); }
protected void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value == null ) { st.setNull( index, sqlTypes( null )[0] ); } else { byte[] toSet = unWrap( value ); final boolean useInputStream = session.getFactory().getDialect().useInputStreamToInsertBlob(); if ( useInputStream ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, new BlobImpl( toSet ) ); } } }
public void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value != null ) { byte[] toSet; toSet = toBytes( value ); if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, new BlobImpl( toSet ) ); } } else { st.setNull( index, sqlTypes( null )[0] ); } }
protected void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value == null ) { st.setNull( index, sqlTypes( null )[0] ); } else { byte[] toSet = unWrap( value ); final boolean useInputStream = session.getFactory().getDialect().useInputStreamToInsertBlob(); if ( useInputStream ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, Hibernate.getLobCreator( session ).createBlob( toSet ) ); } } }
@Override public boolean useStreamForLobBinding() { if ( useStreamForLobBinding == null ) { useStreamForLobBinding = Environment.useStreamsForBinary() || getJdbcServices().getJdbcEnvironment().getDialect().useInputStreamToInsertBlob(); } return useStreamForLobBinding; }