org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactory Java Examples

The following examples show how to use org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractRepositoryUnitTests.java    From spring-data-keyvalue with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {

	KeyValueOperations operations = new KeyValueTemplate(new MapKeyValueAdapter());
	KeyValueRepositoryFactory keyValueRepositoryFactory = createKeyValueRepositoryFactory(operations);

	this.repository = getRepository(keyValueRepositoryFactory);
}
 
Example #2
Source File: CachingQuerySimpleKeyValueRepositoryUnitTests.java    From spring-data-keyvalue with Apache License 2.0 4 votes vote down vote up
@Override
protected KeyValueRepositoryFactory createKeyValueRepositoryFactory(KeyValueOperations operations) {
	return new KeyValueRepositoryFactory(operations, SpelQueryCreator.class, CachingKeyValuePartTreeQuery.class);
}
 
Example #3
Source File: QuerydslKeyValueRepositoryUnitTests.java    From spring-data-keyvalue with Apache License 2.0 4 votes vote down vote up
@Override
protected QPersonRepository getRepository(KeyValueRepositoryFactory factory) {
	return factory.getRepository(QPersonRepository.class);
}
 
Example #4
Source File: AbstractRepositoryUnitTests.java    From spring-data-keyvalue with Apache License 2.0 4 votes vote down vote up
protected KeyValueRepositoryFactory createKeyValueRepositoryFactory(KeyValueOperations operations) {
	return new KeyValueRepositoryFactory(operations);
}
 
Example #5
Source File: SimpleKeyValueRepositoryUnitTests.java    From spring-data-keyvalue with Apache License 2.0 4 votes vote down vote up
protected PersonRepository getRepository(KeyValueRepositoryFactory factory) {
	return factory.getRepository(PersonRepository.class);
}
 
Example #6
Source File: HazelcastRepositoryFactoryBean.java    From spring-data-hazelcast with Apache License 2.0 3 votes vote down vote up
/**
 * <p>
 * Return a {@link HazelcastRepositoryFactory}.
 * </P>
 * <p>
 * {@code super} would return {@link KeyValueRepositoryFactory} which in turn builds {@link KeyValueRepository}
 * instances, and these have a private method that implement querying in a manner that does not fit with Hazelcast.
 * More details are in {@link HazelcastRepositoryFactory}.
 * </P>
 *
 * @param KeyValueOperations
 * @param Query                Creator
 * @param RepositoryQueryType, not used
 * @return A {@link HazelcastRepositoryFactory} that creates {@link HazelcastRepository} instances.
 */
@Override
protected KeyValueRepositoryFactory createRepositoryFactory(KeyValueOperations operations,
                                                            Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
                                                            Class<? extends RepositoryQuery> repositoryQueryType) {
    Assert.state(hazelcastInstance != null, "HazelcastInstance must be set");

    return new HazelcastRepositoryFactory(operations, queryCreator, hazelcastInstance);
}
 
Example #7
Source File: AbstractRepositoryUnitTests.java    From spring-data-keyvalue with Apache License 2.0 votes vote down vote up
protected abstract T getRepository(KeyValueRepositoryFactory factory);