Example usage for org.hibernate.engine.spi SharedSessionContractImplementor connection

List of usage examples for org.hibernate.engine.spi SharedSessionContractImplementor connection

Introduction

In this page you can find the example usage for org.hibernate.engine.spi SharedSessionContractImplementor connection.

Prototype

Connection connection();

Source Link

Usage

From source file:org.openremote.container.persistence.ArrayUserType.java

License:Open Source License

@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index,
        SharedSessionContractImplementor session) throws HibernateException, SQLException {
    if (value == null) {
        statement.setNull(index, SQL_TYPES[0]);
    } else {/*from   www.j a  v  a2 s  .  c om*/
        String[] castObject = (String[]) value;
        Array array = session.connection().createArrayOf("text", castObject);
        statement.setArray(index, array);
    }
}