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

The following examples show how to use org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactory. These examples are extracted from open source projects. 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
@Before
public void setup() {

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

	this.repository = getRepository(keyValueRepositoryFactory);
}
 
Example 2
@Override
protected KeyValueRepositoryFactory createKeyValueRepositoryFactory(KeyValueOperations operations) {
	return new KeyValueRepositoryFactory(operations, SpelQueryCreator.class, CachingKeyValuePartTreeQuery.class);
}
 
Example 3
@Override
protected QPersonRepository getRepository(KeyValueRepositoryFactory factory) {
	return factory.getRepository(QPersonRepository.class);
}
 
Example 4
protected KeyValueRepositoryFactory createKeyValueRepositoryFactory(KeyValueOperations operations) {
	return new KeyValueRepositoryFactory(operations);
}
 
Example 5
protected PersonRepository getRepository(KeyValueRepositoryFactory factory) {
	return factory.getRepository(PersonRepository.class);
}
 
Example 6
/**
 * <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
protected abstract T getRepository(KeyValueRepositoryFactory factory);