|
1 | 1 | /*
|
2 |
| - * Copyright 2013-2017 the original author or authors. |
| 2 | + * Copyright 2013-2018 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -60,24 +60,21 @@ public ElasticsearchRepositoryBean(Bean<ElasticsearchOperations> operations, Set
|
60 | 60 | this.elasticsearchOperationsBean = operations;
|
61 | 61 | }
|
62 | 62 |
|
63 |
| - /* (non-Javadoc) |
64 |
| - * @see org.springframework.data.repository.cdi.CdiRepositoryBean#create(javax.enterprise.context.spi.CreationalContext, java.lang.Class, java.util.Optional) |
| 63 | + /* |
| 64 | + * (non-Javadoc) |
| 65 | + * @see org.springframework.data.repository.cdi.CdiRepositoryBean#create(javax.enterprise.context.spi.CreationalContext, java.lang.Class) |
65 | 66 | */
|
66 | 67 | @Override
|
67 |
| - protected T create(CreationalContext<T> creationalContext, Class<T> repositoryType, |
68 |
| - Optional<Object> customImplementation) { |
| 68 | + protected T create(CreationalContext<T> creationalContext, Class<T> repositoryType) { |
69 | 69 |
|
70 |
| - ElasticsearchOperations elasticsearchOperations = getDependencyInstance(elasticsearchOperationsBean, |
| 70 | + ElasticsearchOperations operations = getDependencyInstance(elasticsearchOperationsBean, |
71 | 71 | ElasticsearchOperations.class);
|
72 | 72 |
|
73 |
| - ElasticsearchRepositoryFactory factory = new ElasticsearchRepositoryFactory(elasticsearchOperations); |
74 |
| - |
75 |
| - return customImplementation // |
76 |
| - .map(o -> factory.getRepository(repositoryType, o)) // |
77 |
| - .orElseGet(() -> factory.getRepository(repositoryType)); |
| 73 | + return create(() -> new ElasticsearchRepositoryFactory(operations), repositoryType); |
78 | 74 | }
|
79 | 75 |
|
80 |
| - /* (non-Javadoc) |
| 76 | + /* |
| 77 | + * (non-Javadoc) |
81 | 78 | * @see org.springframework.data.repository.cdi.CdiRepositoryBean#getScope()
|
82 | 79 | */
|
83 | 80 | @Override
|
|
0 commit comments