DATAJPA-442 - Enable CDI repositories to be instantiated eagerly.

From the CDI extension we now use the callback newly introduced in Spring Data Commons to enable it to trigger eager initialization.

See also: DATACMNS-416.
This commit is contained in:
Oliver Gierke
2014-01-13 12:04:14 +01:00
parent 8a4c04a524
commit f2bc6fc466
3 changed files with 18 additions and 3 deletions

View File

@@ -27,6 +27,8 @@ import org.apache.webbeans.cditest.CdiTestContainer;
import org.apache.webbeans.cditest.CdiTestContainerLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Integration tests for Spring Data JPA CDI extension.
@@ -36,12 +38,17 @@ import org.junit.Test;
*/
public class CdiExtensionIntegrationTests {
private static Logger LOGGER = LoggerFactory.getLogger(CdiExtensionIntegrationTests.class);
static CdiTestContainer container;
@BeforeClass
public static void setUp() throws Exception {
container = CdiTestContainerLoader.getCdiContainer();
container.bootContainer();
LOGGER.debug("CDI container bootstrapped!");
}
/**

View File

@@ -17,6 +17,9 @@ package org.springframework.data.jpa.repository.cdi;
import java.util.List;
import org.springframework.data.repository.cdi.Eager;
@Eager
public interface PersonRepository {
List<Person> findAll();