Package org.hibernate.property

Examples of org.hibernate.property.PropertyAccessor


    if ( parentPropertyName == null ) {
      parentSetter = null;
      parentGetter = null;
    }
    else {
      PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( null );
      parentSetter = pa.getSetter( componentClass, parentPropertyName );
      parentGetter = pa.getGetter( componentClass, parentPropertyName );
    }

    if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
      optimizer = null;
    }
View Full Code Here


    return result;
  }

  private void initialize(String[] aliases) {
    PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
        new PropertyAccessor[] {
            PropertyAccessorFactory.getPropertyAccessor( resultClass, null ),
            PropertyAccessorFactory.getPropertyAccessor( "field" )
        }
    );
    this.aliases = new String[ aliases.length ];
    setters = new Setter[ aliases.length ];
    for ( int i = 0; i < aliases.length; i++ ) {
      String alias = aliases[ i ];
      if ( alias != null ) {
        this.aliases[ i ] = alias;
        setters[ i ] = propertyAccessor.getSetter( resultClass, alias );
      }
    }
    isInitialized = true;
  }
View Full Code Here

    if ( parentPropertyName == null ) {
      parentSetter = null;
      parentGetter = null;
    }
    else {
      PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( null );
      parentSetter = pa.getSetter( componentClass, parentPropertyName );
      parentGetter = pa.getGetter( componentClass, parentPropertyName );
    }

    if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
      optimizer = null;
    }
View Full Code Here

    return result;
  }

  private void initialize(String[] aliases) {
    PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
        new PropertyAccessor[] {
            PropertyAccessorFactory.getPropertyAccessor( resultClass, null ),
            PropertyAccessorFactory.getPropertyAccessor( "field" )
        }
    );
    this.aliases = new String[ aliases.length ];
    setters = new Setter[ aliases.length ];
    for ( int i = 0; i < aliases.length; i++ ) {
      String alias = aliases[ i ];
      if ( alias != null ) {
        this.aliases[ i ] = alias;
        setters[ i ] = propertyAccessor.getSetter( resultClass, alias );
      }
    }
    isInitialized = true;
  }
View Full Code Here

  private static Getter getGetter(Property mappingProperty) {
    if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) {
      return null;
    }

    PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( mappingProperty, EntityMode.POJO );
    return pa.getGetter( mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName() );
  }
View Full Code Here

  private static Getter getGetter(AttributeBinding mappingProperty) {
    if ( mappingProperty == null || mappingProperty.getContainer().getClassReference() == null ) {
      return null;
    }

    PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( mappingProperty, EntityMode.POJO );
    return pa.getGetter(
        mappingProperty.getContainer().getClassReference(),
        mappingProperty.getAttribute().getName()
    );
  }
View Full Code Here

    if ( parentPropertyName == null ) {
      parentSetter = null;
      parentGetter = null;
    }
    else {
      PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( null );
      parentSetter = pa.getSetter( componentClass, parentPropertyName );
      parentGetter = pa.getGetter( componentClass, parentPropertyName );
    }

    if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
      optimizer = null;
    }
View Full Code Here

    return result;
  }

  private void initialize(String[] aliases) {
    PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(
        new PropertyAccessor[] {
            PropertyAccessorFactory.getPropertyAccessor( resultClass, null ),
            PropertyAccessorFactory.getPropertyAccessor( "field" )
        }
    );
    this.aliases = new String[ aliases.length ];
    setters = new Setter[ aliases.length ];
    for ( int i = 0; i < aliases.length; i++ ) {
      String alias = aliases[ i ];
      if ( alias != null ) {
        this.aliases[ i ] = alias;
        setters[ i ] = propertyAccessor.getSetter( resultClass, alias );
      }
    }
    isInitialized = true;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  private void addSubElement(Property property, ValidatableElement element) {
    if ( property != null && property.isComposite() && !property.isBackRef() ) {
      Component component = (Component) property.getValue();
      if ( component.isEmbedded() ) return;
      PropertyAccessor accessor = PropertyAccessorFactory.getPropertyAccessor( property, EntityMode.POJO );
      Getter getter = accessor.getGetter( element.clazz, property.getName() );
      ClassValidator validator = new ClassValidator( getter.getReturnType() );
      ValidatableElement subElement = new ValidatableElement( getter.getReturnType(), validator, getter );
      Iterator properties = component.getPropertyIterator();
      while ( properties.hasNext() ) {
        addSubElement( (Property) properties.next(), subElement );
View Full Code Here

    if ( parentPropertyName == null ) {
      parentSetter = null;
      parentGetter = null;
    }
    else {
      PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( null );
      parentSetter = pa.getSetter( componentClass, parentPropertyName );
      parentGetter = pa.getGetter( componentClass, parentPropertyName );
    }

    if ( hasCustomAccessors || !Environment.useReflectionOptimizer() ) {
      optimizer = null;
    }
View Full Code Here

TOP

Related Classes of org.hibernate.property.PropertyAccessor

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.