Package org.hibernate.ogm.options.container.impl

Examples of org.hibernate.ogm.options.container.impl.OptionsContainerBuilder


    return OptionsContainer.EMPTY;
  }

  @Override
  public OptionsContainer getEntityOptions(Class<?> entityType) {
    OptionsContainerBuilder options = convertOptionAnnotations( entityType.getAnnotations() );
    return options != null ? options.build() : OptionsContainer.EMPTY;
  }
View Full Code Here


    return options != null ? options.build() : OptionsContainer.EMPTY;
  }

  @Override
  public OptionsContainer getPropertyOptions(Class<?> entityType, String propertyName) {
    OptionsContainerBuilder options = getPropertyOptions( entityType ).get( new PropertyKey( entityType, propertyName ) );
    return options != null ? options.build() : OptionsContainer.EMPTY;
  }
View Full Code Here

      String propertyName = ReflectionHelper.getPropertyName( method );
      if ( propertyName == null ) {
        continue;
      }

      final OptionsContainerBuilder optionsOfProperty = convertOptionAnnotations( method.getAnnotations() );
      if ( optionsOfProperty != null ) {
        optionsByProperty.put( new PropertyKey( entityClass, propertyName ), optionsOfProperty );
      }
    }

    for ( final Field field : entityClass.getDeclaredFields() ) {
      PropertyKey key = new PropertyKey( entityClass, field.getName() );
      OptionsContainerBuilder optionsOfField = convertOptionAnnotations( field.getAnnotations() );

      if ( optionsOfField != null ) {
        OptionsContainerBuilder optionsOfProperty = optionsByProperty.get( key );
        if ( optionsOfProperty != null ) {
          optionsOfProperty.addAll( optionsOfField );
        }
        else {
          optionsByProperty.put( key, optionsOfField );
        }
      }
View Full Code Here

    return optionsByProperty;
  }

  private OptionsContainerBuilder convertOptionAnnotations(Annotation[] annotations) {
    OptionsContainerBuilder builder = null;

    for ( Annotation annotation : annotations ) {
      builder = processAnnotation( builder, annotation );
    }
View Full Code Here

  private <A extends Annotation> OptionsContainerBuilder processAnnotation(OptionsContainerBuilder builder, A annotation) {
    AnnotationConverter<Annotation> converter = getConverter( annotation );

    if ( converter != null ) {
      if ( builder == null ) {
        builder = new OptionsContainerBuilder();
      }
      add( builder, converter.convert( annotation ) );
    }

    return builder;
View Full Code Here

  public <V> void addGlobalOption(Option<?, V> option, V value) {
    globalOptions.add( option, value );
  }

  public <V> void addEntityOption(Class<?> entityType, Option<?, V> option, V value) {
    OptionsContainerBuilder entityOptions = optionsPerEntity.get( entityType );

    if ( entityOptions == null ) {
      entityOptions = new OptionsContainerBuilder();
      optionsPerEntity.put( entityType, entityOptions );
    }

    entityOptions.add( option, value );
  }
View Full Code Here

    entityOptions.add( option, value );
  }

  public <V> void addPropertyOption(Class<?> entityType, String propertyName, Option<?, V> option, V value) {
    PropertyKey key = new PropertyKey( entityType, propertyName );
    OptionsContainerBuilder propertyOptions = optionsPerProperty.get( key );

    if ( propertyOptions == null ) {
      propertyOptions = new OptionsContainerBuilder();
      optionsPerProperty.put( key, propertyOptions );
    }

    propertyOptions.add( option, value );
  }
View Full Code Here

  public <V> void addGlobalOption(Option<?, V> option, V value) {
    globalOptions.add( option, value );
  }

  public <V> void addEntityOption(Class<?> entityType, Option<?, V> option, V value) {
    OptionsContainerBuilder entityOptions = optionsPerEntity.get( entityType );

    if ( entityOptions == null ) {
      entityOptions = new OptionsContainerBuilder();
      optionsPerEntity.put( entityType, entityOptions );
    }

    entityOptions.add( option, value );
  }
View Full Code Here

    entityOptions.add( option, value );
  }

  public <V> void addPropertyOption(Class<?> entityType, String propertyName, Option<?, V> option, V value) {
    PropertyKey key = new PropertyKey( entityType, propertyName );
    OptionsContainerBuilder propertyOptions = optionsPerProperty.get( key );

    if ( propertyOptions == null ) {
      propertyOptions = new OptionsContainerBuilder();
      optionsPerProperty.put( key, propertyOptions );
    }

    propertyOptions.add( option, value );
  }
View Full Code Here

    return OptionsContainer.EMPTY;
  }

  @Override
  public OptionsContainer getEntityOptions(Class<?> entityType) {
    OptionsContainerBuilder options = convertOptionAnnotations( entityType.getAnnotations() );
    return options != null ? options.build() : OptionsContainer.EMPTY;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.options.container.impl.OptionsContainerBuilder

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.