Package org.hibernate.ogm.cfg

Examples of org.hibernate.ogm.cfg.OgmConfiguration.configureOptionsFor()


    MockMongoClient mockClient = mockClient().build();

    OgmConfiguration configuration = TestHelper.getDefaultTestConfiguration( getAnnotatedClasses() );
    configuration.getProperties().put( OgmProperties.DATASTORE_PROVIDER, new MongoDBDatastoreProvider( mockClient.getClient() ) );
    configuration.getProperties().put( DocumentStoreProperties.ASSOCIATIONS_STORE, AssociationStorageType.ASSOCIATION_DOCUMENT );
    configuration.configureOptionsFor( MongoDB.class )
      .entity( GolfPlayer.class )
        .writeConcern( WriteConcernType.REPLICA_ACKNOWLEDGED )
        .property( "playedCourses", ElementType.FIELD )
          .writeConcern( WriteConcernType.ACKNOWLEDGED );
View Full Code Here


  }

  @Test
  public void testThatEntityOptionCanBeSetAndRetrieved() throws Exception {
    OgmConfiguration configuration = getConfiguration();
    configuration.configureOptionsFor( SampleNoSqlDatastore.class )
      .entity( Refrigerator.class )
        .force( true );

    setupSessionFactory( configuration );
View Full Code Here

  }

  @Test
  public void testThatEntityOptionsCanBeSetAndRetrievedOnMultipleTypes() throws Exception {
    OgmConfiguration configuration = getConfiguration();
    configuration.configureOptionsFor( SampleNoSqlDatastore.class )
      .entity( Refrigerator.class )
        .force( true )
      .entity( Microwave.class )
        .name( "test" );
View Full Code Here

  }

  @Test
  public void testThatPropertyOptionCanBeSetAndRetrieved() throws Exception {
    OgmConfiguration configuration = getConfiguration();
    configuration.configureOptionsFor( SampleNoSqlDatastore.class )
      .entity( Refrigerator.class )
        .property( "temperature", ElementType.FIELD )
          .embed( "Embedded" );

    setupSessionFactory( configuration );
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.