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:
@@ -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();
|
||||
}
|
||||
@@ -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() {
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user