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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
  */
 package org.hibernate.ogm.options.navigation.source.impl;
 
A OptionValueSource which provides access to options configured using a property in persistence.xml or similar. Such options will be provided on the global configuration level. Only unique options are supported.

Author(s):
Gunnar Morling
	}
		return ;
	}
	public OptionsContainer getEntityOptions(Class<?> entityType) {
	}
	public OptionsContainer getPropertyOptions(Class<?> entityTypeString propertyName) {
	}

An org.hibernate.ogm.options.container.impl.OptionsContainer which provides access to unique options configured using a property.

Author(s):
Gunnar Morling
	private static class ConfigurationBasedOptionContainer implements OptionsContainer {
		private static final Log log = LoggerFactory.make();
			this. = propertyReader;
		}
		public <I, V> V get(Class<? extends Option<I, V>> optionType, I identifier) {
			return null;
		}
		public <V> V getUnique(Class<? extends UniqueOption<V>> optionType) {
			try {
				return optionType.newInstance().getDefaultValue );
			}
			catch (Exception e) {
				throw .unableToInstantiateTypeoptionTypee );
			}
		}
		public <I, V, T extends Option<I, V>> Map<I, V> getAll(Class<T> optionType) {
			try {
option = optionType.newInstance();
value = option.getDefaultValue );
				return value != null ? Collections.<I, V>singletonMapoption.getOptionIdentifier(), value ) : Collections.<I, V>emptyMap();
			}
			catch (Exception e) {
				throw .unableToInstantiateTypeoptionTypee );
			}
		}
	}
New to GrepCode? Check out our FAQ X