Package org.hibernate

Examples of org.hibernate.PropertyAccessException


  public Object[] getPropertyValues(Object object) {
    try {
      return bulkBean.getPropertyValues( object );
    }
    catch ( Throwable t ) {
      throw new PropertyAccessException(
          t,
              PROPERTY_GET_EXCEPTION,
              false,
              mappedClass,
              getterName( t, bulkBean )
View Full Code Here


  public void setPropertyValues(Object object, Object[] values) {
    try {
      bulkBean.setPropertyValues( object, values );
    }
    catch ( Throwable t ) {
      throw new PropertyAccessException(
          t,
              PROPERTY_SET_EXCEPTION,
              true,
              mappedClass,
              setterName( t, bulkBean )
View Full Code Here

      try {
        method.invoke( target, new Object[] { value } );
      }
      catch (NullPointerException npe) {
        if ( value==null && method.getParameterTypes()[0].isPrimitive() ) {
          throw new PropertyAccessException(
              npe,
              "Null value was assigned to a property of primitive type",
              true,
              clazz,
              propertyName
            );
        }
        else {
          throw new PropertyAccessException(
              npe,
              "NullPointerException occurred while calling",
              true,
              clazz,
              propertyName
            );
        }
      }
      catch (InvocationTargetException ite) {
        throw new PropertyAccessException(
            ite,
            "Exception occurred inside",
            true,
            clazz,
            propertyName
          );
      }
      catch (IllegalAccessException iae) {
        throw new PropertyAccessException(
            iae,
            "IllegalAccessException occurred while calling",
            true,
            clazz,
            propertyName
          );
        //cannot occur
      }
      catch (IllegalArgumentException iae) {
        if ( value==null && method.getParameterTypes()[0].isPrimitive() ) {
          throw new PropertyAccessException(
              iae,
              "Null value was assigned to a property of primitive type",
              true,
              clazz,
              propertyName
            );
        }
        else {
          log.error(
              "IllegalArgumentException in class: " + clazz.getName() +
              ", setter method of property: " + propertyName
            );
          log.error(
              "expected type: " +
              method.getParameterTypes()[0].getName() +
              ", actual value: " +
              ( value==null ? null : value.getClass().getName() )
            );
          throw new PropertyAccessException(
              iae,
              "IllegalArgumentException occurred while calling",
              true,
              clazz,
              propertyName
View Full Code Here

    public Object get(Object target) throws HibernateException {
      try {
        return method.invoke(target, null);
      }
      catch (InvocationTargetException ite) {
        throw new PropertyAccessException(
            ite,
            "Exception occurred inside",
            false,
            clazz,
            propertyName
          );
      }
      catch (IllegalAccessException iae) {
        throw new PropertyAccessException(
            iae,
            "IllegalAccessException occurred while calling",
            false,
            clazz,
            propertyName
          );
        //cannot occur
      }
      catch (IllegalArgumentException iae) {
        log.error(
            "IllegalArgumentException in class: " + clazz.getName() +
            ", getter method of property: " + propertyName
          );
        throw new PropertyAccessException(
            iae,
            "IllegalArgumentException occurred calling",
            false,
            clazz,
            propertyName
View Full Code Here

    public Object get(Object target) throws HibernateException {
      try {
        return field.get(target);
      }
      catch (Exception e) {
        throw new PropertyAccessException(e, "could not get a field value by reflection", false, clazz, name);
      }
    }
View Full Code Here

      try {
        field.set(target, value);
      }
      catch (Exception e) {
        if(value == null && field.getType().isPrimitive()) {
          throw new PropertyAccessException(
              e,
              "Null value was assigned to a property of primitive type",
              true,
              clazz,
              name
            );         
        } else {
          throw new PropertyAccessException(e, "could not set a field value by reflection", true, clazz, name);
        }
      }
    }
View Full Code Here

  public Object[] getPropertyValues(Object object) {
    try {
      return bulkAccessor.getPropertyValues( object );
    }
    catch ( Throwable t ) {
      throw new PropertyAccessException(
          t,
              PROPERTY_GET_EXCEPTION,
              false,
              mappedClass,
              getterName( t, bulkAccessor )
View Full Code Here

  public void setPropertyValues(Object object, Object[] values) {
    try {
      bulkAccessor.setPropertyValues( object, values );
    }
    catch ( Throwable t ) {
      throw new PropertyAccessException(
          t,
              PROPERTY_SET_EXCEPTION,
              true,
              mappedClass,
              setterName( t, bulkAccessor )
View Full Code Here

  public Object[] getPropertyValues(Object object) {
    try {
      return bulkBean.getPropertyValues( object );
    }
    catch ( Throwable t ) {
      throw new PropertyAccessException(
          t,
              PROPERTY_GET_EXCEPTION,
              false,
              mappedClass,
              getterName( t, bulkBean )
View Full Code Here

  public void setPropertyValues(Object object, Object[] values) {
    try {
      bulkBean.setPropertyValues( object, values );
    }
    catch ( Throwable t ) {
      throw new PropertyAccessException(
          t,
              PROPERTY_SET_EXCEPTION,
              true,
              mappedClass,
              setterName( t, bulkBean )
View Full Code Here

TOP

Related Classes of org.hibernate.PropertyAccessException

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.