hibernate/hibernate-ogm — pull request #235 by gunnarmorling (2013-10-15 10:40:01+00:00)
Title: OGM-338

Established API which allows the user to set store-specific options via `OgmSession`:

OgmSession session = ...;
SampleGlobalContext configuration = session.configureDatastore( SampleNoSqlDatastore.class );
configuration
.entity( Refrigerator.class )
.force( true )
.entity( Microwave.class )
.name( "test" );

The options are managed by `OptionsServiceImpl` which implements `OptionsService` for reading options and `ConfigurationBuilderService` for obtaining configuration builders which amend options to the internal context keeping track of all configured options.

The previous context class has been split into two classes: a thread-safe `OptionsContext` which keeps track of all options set per session factory or per session (the latter is not yet implemented) and `ConfigurationContext` which is used as invocation context for one invocation chain of the fluent API (internally it adds to the shared `OptionsContext`).

Also removed `MappingFactory` indirection, datastore providers return global contexts directly instead.