I want to inject a Spring Data JpaRepository into a goodle cloud endpoint class. How can I do this? Because I think currentliy the cloud endpoint class is not under Spring control and the autowired annotated repository remains always to null.
Some one found a solution for guice Appengine with Google Cloud Endpoints and Guice
What I want to do is the Same with Spring. So I want to bring up the cloud endpoints with the spring context.
Currently I do it over the Spring context to get my repositories like:
@Api(name = "myapi", version = "v1", scopes = { Constants.EMAIL_SCOPE }, clientIds = {
Constants.WEB_CLIENT_ID, Constants.ANDROID_CLIENT_ID,
Constants.IOS_CLIENT_ID, Constants.API_EXPLORER_CLIENT_ID }, audiences = {
Constants.ANDROID_AUDIENCE })
public class TestServiceImpl {
// @Autowired
private TestRepository repository;
public TestServiceImpl () {
repository = ApplicationContextProvider.getApplicationContext()
.getBean(TestRepository.class);
}
....
}
But I want to use Autowired, is that possible?