Package org.hibernate.exception.spi

Examples of org.hibernate.exception.spi.SQLExceptionConversionDelegate


    return false;
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );

        if ( "41000".equals( sqlState ) ) {
View Full Code Here


    }
  };
 
  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );

        if ( "40P01".equals( sqlState ) ) {
View Full Code Here

    return sql + new ForUpdateFragment( this, aliasedLockOptions, keyColumnNames ).toFragmentString();
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
        if("JZ0TO".equals( sqlState ) || "JZ006".equals( sqlState )){
View Full Code Here

    return sqlCode == Types.BOOLEAN ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
View Full Code Here

    return true;
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(final SQLException sqlException, final String message, final String sql) {

        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
View Full Code Here

  };

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        // interpreting Oracle exceptions is much much more precise based on their specific vendor codes.

        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
View Full Code Here

    }
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
        if ( "HY008".equals( sqlState ) ) {
View Full Code Here

    }
  };

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    SQLExceptionConversionDelegate delegate = super.buildSQLExceptionConversionDelegate();
    if (delegate == null) {
      delegate = new SQLExceptionConversionDelegate() {
        @Override
        public JDBCException convert(SQLException sqlException, String message, String sql) {
          final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );

          if (40001 == errorCode) {
View Full Code Here

    return sql + new ForUpdateFragment( this, aliasedLockOptions, keyColumnNames ).toFragmentString();
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        if("JZ0TO".equals( sqlState ) || "JZ006".equals( sqlState )){
          throw new LockTimeoutException( message, sqlException, sql );
View Full Code Here

    return sqlCode == Types.BOOLEAN ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
  }

  @Override
  public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
View Full Code Here

TOP

Related Classes of org.hibernate.exception.spi.SQLExceptionConversionDelegate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.