DATAREDIS-785 - Export composable repositories via CDI.

We now export composable repositories through our CDI extension. Repositories can now be customized either by a single custom implementation (as it was before) and by providing fragment interfaces along their fragment implementation.

This change aligns CDI support with the existing RepositoryFactory support we provide within a Spring application context.
This commit is contained in:
Mark Paluch
2018-03-12 16:41:04 +01:00
parent 2bc940a558
commit 567fa43e60
4 changed files with 11 additions and 11 deletions

View File

@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.redis.repository.cdi;
/**
* @author Mark Paluch
*/
interface PersonRepositoryCustom {
interface PersonFragment {
int returnOne();
}

View File

@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.redis.repository.cdi;
/**
* @author Mark Paluch
*/
public class PersonRepositoryImpl implements PersonRepositoryCustom {
public class PersonFragmentImpl implements PersonFragment {
@Override
public int returnOne() {

View File

@@ -24,7 +24,7 @@ import org.springframework.data.repository.cdi.Eager;
* @author Mark Paluch
*/
@Eager
public interface PersonRepository extends CrudRepository<Person, String>, PersonRepositoryCustom {
public interface PersonRepository extends CrudRepository<Person, String>, PersonFragment {
List<Person> findAll();