Example usage for org.hibernate HibernateException HibernateException

List of usage examples for org.hibernate HibernateException HibernateException

Introduction

In this page you can find the example usage for org.hibernate HibernateException HibernateException.

Prototype

public HibernateException(String message, Throwable cause) 

Source Link

Document

Constructs a HibernateException using the given message and underlying cause.

Usage

From source file:kakan.dao.DAO.java

protected void manejaExcepcion(HibernateException he) throws HibernateException {
    tx.rollback();/*from  w  ww  .  j  av  a  2s  . c o m*/
    throw new HibernateException("Ocurri un error en la capa de acceso a datos", he);
}

From source file:kr.debop4j.data.hibernate.usertype.compress.AbstractCompressedBinaryUserType.java

License:Apache License

@Override
public Object nullSafeGet(final ResultSet resultSet, final String[] strings,
        final SessionImplementor sessionImplementor, final Object o) throws HibernateException, SQLException {
    try {/*from w w w. ja v  a2s  . c o m*/
        byte[] value = BinaryType.INSTANCE.nullSafeGet(resultSet, strings[0], sessionImplementor);
        return decompress(value);
    } catch (Exception ex) {
        log.error("column=" + strings[0] + "  ?  ?? .", ex);
        throw new HibernateException("?  ?? .", ex);
    }
}

From source file:kr.debop4j.data.hibernate.usertype.compress.AbstractCompressedBinaryUserType.java

License:Apache License

@Override
public void nullSafeSet(final PreparedStatement preparedStatement, final Object o, final int i,
        final SessionImplementor sessionImplementor) throws HibernateException, SQLException {
    try {//from   ww  w .ja  v a 2 s.  co m
        byte[] value = ArrayTool.isEmpty((byte[]) o) ? null : compress((byte[]) o);
        BinaryType.INSTANCE.nullSafeSet(preparedStatement, value, i, sessionImplementor);
    } catch (Exception ex) {
        log.error("Statement=[{}], index=[{}]?  ? ? .",
                preparedStatement, i);
        throw new HibernateException(" ? .", ex);
    }
}

From source file:kr.debop4j.data.hibernate.usertype.compress.AbstractCompressedStringUserType.java

License:Apache License

@Override
public Object nullSafeGet(final ResultSet resultSet, final String[] strings,
        final SessionImplementor sessionImplementor, final Object o) throws HibernateException, SQLException {
    try {/*from www  .  j ava2  s .c  om*/
        byte[] value = BinaryType.INSTANCE.nullSafeGet(resultSet, strings[0], sessionImplementor);
        return decompress(value);
    } catch (Exception ex) {
        log.error("column=[" + strings[0] + "]  ?  ?? .",
                ex);
        throw new HibernateException("?  ?? .", ex);
    }
}

From source file:kr.debop4j.data.hibernate.usertype.compress.AbstractCompressedStringUserType.java

License:Apache License

@Override
public void nullSafeSet(final PreparedStatement preparedStatement, final Object o, final int i,
        final SessionImplementor sessionImplementor) throws HibernateException, SQLException {
    try {// ww w  . j  a  v a  2  s.  co  m
        byte[] value = compress((String) o);
        BinaryType.INSTANCE.nullSafeSet(preparedStatement, value, i, sessionImplementor);
    } catch (Exception ex) {
        log.error("Statement=[" + preparedStatement + "], index=[" + i
                + "]?  ? ? .", ex);
        throw new HibernateException("?  ?? .", ex);
    }
}

From source file:kr.debop4j.data.hibernate.usertype.cryptography.AbstractSymmetricEncryptStringUserType.java

License:Apache License

@Override
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
        throws HibernateException, SQLException {
    try {//from ww  w. j a va  2 s  . c om
        String hexStr = StringType.INSTANCE.nullSafeGet(rs, names[0], session);
        return decrypt(hexStr);
    } catch (Exception ex) {
        throw new HibernateException(" ?? .", ex);
    }
}

From source file:kr.debop4j.data.hibernate.usertype.cryptography.AbstractSymmetricEncryptStringUserType.java

License:Apache License

@Override
public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
        throws HibernateException, SQLException {
    try {//w  w  w.  java2 s.  c o  m
        StringType.INSTANCE.nullSafeSet(st, encrypt((String) value), index, session);
    } catch (Exception ex) {
        throw new HibernateException(" ? .", ex);
    }
}

From source file:kr.debop4j.data.hibernate.usertype.StringEnumUserType.java

License:Apache License

@Override
@SuppressWarnings("unchecked")
public void setParameterValues(final Properties parameters) {
    String enumClassName = parameters.getProperty("enumClassName");
    try {//from w  w w  .  j a  v a 2s. c om
        enumClass = ReflectHelper.classForName(enumClassName);
    } catch (ClassNotFoundException e) {
        throw new HibernateException("Enum class not found. enumClassName=" + enumClassName, e);
    }
}

From source file:lissa.dao.AtencionOcupacionalDao.java

private void manejaExcepcion(HibernateException he) {
    tx.rollback();/*from   w w  w.  j ava  2 s . co  m*/
    throw new HibernateException("Ocurri un error en la capa de acceso a datos", he);
}

From source file:model.ClasseDAO.java

private void tractaExcepcio(HibernateException he) throws HibernateException {
    tx.rollback();/*from   w  w w.  java  2s . co  m*/
    throw new HibernateException("Error a la capa d'accs a dades", he);
}