Package org.hibernate.ogm.test.options.examples

Examples of org.hibernate.ogm.test.options.examples.NameExampleOption


  @Test
  public void shouldProvideUniqueOptionValueFromPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";
    optionsServiceContext.addPropertyOption( entityType, propertyName, new NameExampleOption(), "foobar" );

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

    // then
View Full Code Here


  public void shouldProvideUniqueOptionValueFromEntityLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

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

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

    // then
View Full Code Here

  public void shouldProvideUniqueOptionValueFromGlobalLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addGlobalOption( new NameExampleOption(), "foobar" );

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

    // then
View Full Code Here

  public void shouldGiveOptionValueFromPropertyLevelPrecedenceOverEntityLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

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

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

    // then
View Full Code Here

  public void shouldGiveOptionValueConfiguredViaApiPrecedenceOverAnnotation() {
    // given
    Class<?> entityType = Baz.class;
    String propertyName = "qux";

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

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

    // then
View Full Code Here

  public void shouldGiveOptionValueConfiguredViaAnnotationOnPropertyLevelPrecedenceOverApiConfiguredValueOnEntityLevel() {
    // given
    Class<?> entityType = Baz.class;
    String propertyName = "qux";

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

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

    // then
View Full Code Here

  public void shouldGiveValueFromLocalPropertyLevelPrecedenceOverValueFromSuperTypePropertyLevel() {
    // given
    Class<?> entityType = BazExt.class;
    String propertyName = "qux";

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

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

    // then
View Full Code Here

  @Test
  public void shouldGiveValueFromSuperTypePropertyLevelPrecedenceOverValueFromLocalEntityLevel() {
    // given
    Class<?> entityType = BazExt.class;
    String propertyName = "qux";
    optionsServiceContext.addEntityOption( entityType, new NameExampleOption(), "foo" );

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

    // then
View Full Code Here

  @Test
  public void shouldGiveGlobalOptionSetViaApiPrecedenceOverValueSetViaProperty() {
    // given
    cfg.put( NameExampleOption.NAME_OPTION, "foobarqax" );
    optionsServiceContext.addGlobalOption( new NameExampleOption(), "foobar" );

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

    // then
View Full Code Here

      return this;
    }

    @Override
    public SampleEntityContext name(String name) {
      addEntityOption( new NameExampleOption(), name );
      return this;
    }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.test.options.examples.NameExampleOption

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.