Examples of OptionsContext


Examples of org.hibernate.ogm.options.spi.OptionsContext

    optionsServiceContext.addEntityOption( entityType, new NameExampleOption(), "foobar" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new NameExampleOption(), "barfoo" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "barfoo" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

    String propertyName = "qux";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new NameExampleOption(), "foo" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "foo" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

    String propertyName = "qux";

    optionsServiceContext.addEntityOption( entityType, new NameExampleOption(), "foo" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "qux" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

    // given
    Class<?> entityType = BazExt.class;
    String propertyName = "qux";

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "qux" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

    String propertyName = "qux";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new NameExampleOption(), "foo" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "foo" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

    Class<?> entityType = BazExt.class;
    String propertyName = "qux";
    optionsServiceContext.addEntityOption( entityType, new NameExampleOption(), "foo" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "qux" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

  public void shouldProvideAccessToGlobalOptionSetViaProperty() {
    // given
    cfg.put( NameExampleOption.NAME_OPTION, "foobarqax" );

    // when
    OptionsContext context = OptionsContextImpl.forGlobal( getSources() );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "foobarqax" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

    // given
    cfg.put( NameExampleOption.NAME_OPTION, "foobarqax" );
    optionsServiceContext.addGlobalOption( new NameExampleOption(), "foobar" );

    // when
    OptionsContext context = OptionsContextImpl.forGlobal( getSources() );

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "foobar" );
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

      .entity( Refrigerator.class )
        .force( true );

    setupSessionFactory( configuration );

    OptionsContext refrigatorOptions = getOptionsContext().getEntityOptions( Refrigerator.class );
    assertThat( refrigatorOptions.getUnique( ForceExampleOption.class ) ).isTrue();
  }
View Full Code Here

Examples of org.hibernate.ogm.options.spi.OptionsContext

      .entity( Microwave.class )
        .name( "test" );

    setupSessionFactory( configuration );

    OptionsContext refrigatorOptions = getOptionsContext().getEntityOptions( Refrigerator.class );
    assertThat( refrigatorOptions.getUnique( ForceExampleOption.class ) ).isTrue();

    OptionsContext microwaveOptions = getOptionsContext().getEntityOptions( Microwave.class );
    assertThat( microwaveOptions.getUnique( NameExampleOption.class ) ).isEqualTo( "test" );
  }
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.