DATAES-45 - Prepare 1.0 M1 release.

Upgraded to Spring Data Build 1.3.0 RC1 and Spring Data Commons 1.7.0.RC1. Cleaned up pom accordingly.

Adapted repository setup to accommodate for changed lifecycle behavior of repository factories. Marked repositories explicitly created to check for the detection of misconfiguration as @Lazy to prevent them from being instantiated and causing the tests to fail. Added assertion in ElasticsearchEntityInformationCreatorImpl to eagerly fail in case of misconfiguration.

Marked ElasticsearchCrudRepository as @NoRepositoryBean as it should never be considered to be a repository interface to be instantiated.

Tweaked CDI implementation to benefit from new feature in Spring Data Commons to eagerly instantiate CDI repository beans. Fixed capitalization in CDI integration test sample repositories to let the code compile on case-sensitive file systems.
This commit is contained in:
Oliver Gierke
2014-02-07 10:00:46 +01:00
parent 06bfb6778b
commit a33a48a882
9 changed files with 39 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,12 +15,15 @@
*/
package org.springframework.data.elasticsearch.repositories;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.elasticsearch.NonDocumentEntity;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
/**
* @author Rizwan Idrees
* @author Mohsin Husen
* @author Oliver Gierke
*/
@Lazy
public interface NonDocumentEntityRepository extends ElasticsearchRepository<NonDocumentEntity, String> {
}

View File

@@ -20,10 +20,9 @@ import org.springframework.data.repository.CrudRepository;
/**
* @author Mohsin Husen
* @author Oliver Gierke
*/
public interface CDIProductRepository extends CrudRepository<Product, String> {
public interface CdiProductRepository extends CrudRepository<Product, String> {
Product findOne(String id);
}

View File

@@ -19,17 +19,18 @@ import javax.inject.Inject;
/**
* @author Mohsin Husen
* @author Oliver Gierke
*/
class CDIRepositoryClient {
class CdiRepositoryClient {
private CDIProductRepository repository;
private CdiProductRepository repository;
public CDIProductRepository getRepository() {
public CdiProductRepository getRepository() {
return repository;
}
@Inject
public void setRepository(CDIProductRepository repository) {
public void setRepository(CdiProductRepository repository) {
this.repository = repository;
}

View File

@@ -26,10 +26,10 @@ import static org.junit.Assert.*;
* @author Mohsin Husen
*/
public class CDIRepositoryTests {
public class CdiRepositoryTests {
private static CdiTestContainer cdiContainer;
private CDIProductRepository repository;
private CdiProductRepository repository;
@BeforeClass
public static void init() throws Exception {
@@ -46,7 +46,7 @@ public class CDIRepositoryTests {
@Before
public void setUp() {
CDIRepositoryClient client = cdiContainer.getInstance(CDIRepositoryClient.class);
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
repository = client.getRepository();
}