Package org.hibernate.type.descriptor

Examples of org.hibernate.type.descriptor.ValueBinder


  @Override
  @SuppressWarnings("unchecked")
  public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
    // Get the binder for the intermediate type representation
    final ValueBinder realBinder = delegate.getBinder( intermediateJavaTypeDescriptor );
    return new BasicBinder<X>( javaTypeDescriptor, this ) {
      @Override
      @SuppressWarnings("unchecked")
      protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
        final Object convertedValue;
        try {
          convertedValue = converter.convertToDatabaseColumn( value );
        }
        catch (PersistenceException pe) {
          throw pe;
        }
        catch (RuntimeException re) {
          throw new PersistenceException( "Error attempting to apply AttributeConverter", re );
        }
        realBinder.bind( st, convertedValue, index, options );
      }
    };
  }
View Full Code Here


  @Override
  @SuppressWarnings("unchecked")
  public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
    // Get the binder for the intermediate type representation
    final ValueBinder realBinder = delegate.getBinder( intermediateJavaTypeDescriptor );
    return new BasicBinder<X>( javaTypeDescriptor, this ) {
      @Override
      @SuppressWarnings("unchecked")
      protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
        final Object convertedValue;
        try {
          convertedValue = converter.convertToDatabaseColumn( value );
        }
        catch (PersistenceException pe) {
          throw pe;
        }
        catch (RuntimeException re) {
          throw new PersistenceException( "Error attempting to apply AttributeConverter", re );
        }
        realBinder.bind( st, convertedValue, index, options );
      }
    };
  }
View Full Code Here

      return delegate.canBeRemapped();
    }

    @Override
    public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
      final ValueBinder realBinder = delegate.getBinder( javaTypeDescriptor );
      return new BasicBinder<X>( javaTypeDescriptor, this ) {
        @Override
        @SuppressWarnings("unchecked")
        protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options)
            throws SQLException {
          realBinder.bind( st, converter.convertToDatabaseColumn( value ), index, options );
        }
      };
    }
View Full Code Here

      return delegate.canBeRemapped();
    }

    @Override
    public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
      final ValueBinder realBinder = delegate.getBinder( javaTypeDescriptor );
      return new BasicBinder<X>( javaTypeDescriptor, this ) {
        @Override
        @SuppressWarnings("unchecked")
        protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options)
            throws SQLException {
          realBinder.bind( st, converter.convertToDatabaseColumn( value ), index, options );
        }
      };
    }
View Full Code Here

TOP

Related Classes of org.hibernate.type.descriptor.ValueBinder

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.