Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Hibernate OGM, Domain model persistence for NoSQL datastores
   * License: GNU Lesser General Public License (LGPL), version 2.1 or later
   * See the lgpl.txt file in the root directory or <>.
  package org.hibernate.ogm.cfg;
An instance of OgmConfiguration allows the application to specify properties and mapping documents to be used when creating an org.hibernate.ogm.OgmSessionFactory.

Davide D'Alto
 public class OgmConfiguration extends Configuration implements Configurable {
 	public OgmConfiguration() {
 	private void resetOgm() {
 		//NOTE: When performing changes here, be sure to do the same in setProperties() below
 		HibernateSearchIntegration.resetPropertiesthis );
 		// by default use the new id generator scheme...
 	public Mapping buildMapping() {
 		final Mapping delegate = super.buildMapping();
 		return new Mapping() {
 			public Type getIdentifierType(String entityNamethrows MappingException {
 				return delegate.getIdentifierTypeentityName );
 			public String getIdentifierPropertyName(String entityNamethrows MappingException {
 				return delegate.getIdentifierPropertyNameentityName );
 			public Type getReferencedPropertyType(String entityNameString propertyNamethrows MappingException {
 				return delegate.getReferencedPropertyTypeentityNamepropertyName );
	public Configuration setProperties(Properties properties) {
		super.setPropertiesproperties );
		//Unless the new configuration properties explicitly disable OGM's default properties
		//assume there was no intention to disable them:
		if ( ! properties.containsKey. ) ) {
		if ( !properties.containsKey. ) ) {
		HibernateSearchIntegration.setPropertiesIfUndefinedpropertiesthis );
		return this;

Applies configuration options to the bootstrapped session factory. Use either this method or pass a OptionConfigurator via OgmProperties.OPTION_CONFIGURATOR but don't use both at the same time.

datastoreType represents the datastore to be configured; it is the responsibility of the caller to make sure that this matches the underlying datastore provider.
a context object representing the entry point into the fluent configuration API.
	public <D extends DatastoreConfiguration<G>, G extends GlobalContext<?, ?>> G configureOptionsFor(Class<D> datastoreType) {
		ConfigurableImpl configurable = new ConfigurableImpl();
		return configurable.configureOptionsFordatastoreType );
New to GrepCode? Check out our FAQ X