Examples of PropertyAccessor


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

Examples of org.hibernate.property.PropertyAccessor

    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

Examples of org.hibernate.property.PropertyAccessor

  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

Examples of org.hibernate.property.PropertyAccessor

  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

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

Examples of org.hibernate.property.PropertyAccessor

    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

Examples of org.hibernate.property.PropertyAccessor

  @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

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

Examples of org.hivedb.util.PropertyAccessor

  public static<T> T newInstance( Class<T> clazz ){
    return newInstance(clazz, getDefaultInterceptor(clazz));
  }
 
  public static<T> T newInstance( Class<T> clazz, MethodInterceptor interceptor, Map<String, Object> prototype ){
    PropertyAccessor instance = (PropertyAccessor) newInstance(clazz, interceptor);
    for (String propertyName : ReflectionTools.getPropertiesOfGetters((Class<?>)clazz))
      instance.set(propertyName, prototype.get(propertyName));
    return (T) instance;
  }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.common.PropertyAccessor

    }

    private void processPropertyAnnotations(DescriptorPolicy descriptorPolicy) {
        boolean noPlanningEntityPropertyAnnotation = true;
        for (PropertyDescriptor propertyDescriptor : solutionBeanInfo.getPropertyDescriptors()) {
            PropertyAccessor propertyAccessor = new ReflectionPropertyAccessor(propertyDescriptor);
            propertyAccessorMap.put(propertyAccessor.getName(), propertyAccessor);
            Method propertyGetter = propertyAccessor.getReadMethod();
            if (propertyGetter != null) {
                if (propertyGetter.isAnnotationPresent(PlanningEntityProperty.class)) {
                    noPlanningEntityPropertyAnnotation = false;
                    entityPropertyAccessorMap.put(propertyAccessor.getName(), propertyAccessor);
                } else if (propertyGetter.isAnnotationPresent(PlanningEntityCollectionProperty.class)) {
                    noPlanningEntityPropertyAnnotation = false;
                    if (!Collection.class.isAssignableFrom(propertyAccessor.getPropertyType())) {
                        throw new IllegalStateException("The solutionClass (" + solutionClass
                                + ") has a PlanningEntityCollection annotated property ("
                                + propertyAccessor.getName() + ") that does not return a Collection.");
                    }
                    entityCollectionPropertyAccessorMap.put(propertyAccessor.getName(), propertyAccessor);
                }
            }
        }
        if (noPlanningEntityPropertyAnnotation) {
            throw new IllegalStateException("The solutionClass (" + solutionClass
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.