DATACOUCH-3 - Renamed base package to org.springframework.data.couchbase.

This commit is contained in:
Oliver Gierke
2013-06-01 11:47:32 +02:00
parent 4999f23f09
commit a0b3335084
45 changed files with 116 additions and 101 deletions

View File

@@ -146,7 +146,7 @@ Look at the folling bean configuration, which we'll break down afterwards:
<constructor-arg name="pwd" value="" />
</bean>
<bean id="cacheManager" class="com.couchbase.spring.cache.CouchbaseCacheManager">
<bean id="cacheManager" class="org.springframework.data.couchbase.cache.CouchbaseCacheManager">
<constructor-arg>
<util:map>
<entry key="default" value-ref="couchbaseClient" />
@@ -163,7 +163,7 @@ You should be able to identify the `couchbaseClient` bean, which we'll defined p
That's all it takes to have Couchbase cache your objects. Now we can go through a quick example to show how it works. Assume the following class inside the `com.couchbase.example` package:
```java
package com.couchbase.spring;
package org.springframework.data.couchbase;
import org.springframework.cache.annotation.Cacheable;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.cache;
package org.springframework.data.couchbase.cache;
import com.couchbase.client.CouchbaseClient;
import net.spy.memcached.internal.OperationFuture;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.cache;
package org.springframework.data.couchbase.cache;
import com.couchbase.client.CouchbaseClient;
import java.util.Collection;

View File

@@ -20,13 +20,9 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.config;
package org.springframework.data.couchbase.config;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.core.CouchbaseMappingContext;
import com.couchbase.spring.core.CouchbaseTemplate;
import com.couchbase.spring.core.convert.MappingCouchbaseConverter;
import com.couchbase.spring.core.mapping.Document;
import java.util.HashSet;
import java.util.Set;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -35,6 +31,10 @@ import org.springframework.context.annotation.ClassPathScanningCandidateComponen
import org.springframework.context.annotation.Configuration;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.data.annotation.Persistent;
import org.springframework.data.couchbase.core.CouchbaseMappingContext;
import org.springframework.data.couchbase.core.CouchbaseTemplate;
import org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
public interface BucketCallback<T> {

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.DataAccessResourceFailureException;

View File

@@ -20,16 +20,16 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
import com.couchbase.spring.core.mapping.BasicCouchbasePersistentEntity;
import com.couchbase.spring.core.mapping.BasicCouchbasePersistentProperty;
import com.couchbase.spring.core.mapping.CouchbasePersistentProperty;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.data.couchbase.core.mapping.BasicCouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.BasicCouchbasePersistentProperty;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.mapping.context.AbstractMappingContext;
import org.springframework.data.mapping.model.SimpleTypeHolder;
import org.springframework.data.util.TypeInformation;

View File

@@ -20,12 +20,13 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
import com.couchbase.spring.core.convert.CouchbaseConverter;
import java.util.Collection;
import org.springframework.data.couchbase.core.convert.CouchbaseConverter;
public interface CouchbaseOperations {
/**

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
import java.util.Collection;
import java.util.Collections;
@@ -30,14 +30,15 @@ import java.util.List;
import java.util.Set;
import net.spy.memcached.internal.OperationFuture;
import org.springframework.data.couchbase.core.convert.CouchbaseConverter;
import org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter;
import org.springframework.data.couchbase.core.mapping.ConvertedCouchbaseDocument;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.mapping.context.MappingContext;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.core.convert.CouchbaseConverter;
import com.couchbase.spring.core.convert.MappingCouchbaseConverter;
import com.couchbase.spring.core.mapping.ConvertedCouchbaseDocument;
import com.couchbase.spring.core.mapping.CouchbasePersistentEntity;
import com.couchbase.spring.core.mapping.CouchbasePersistentProperty;
public class CouchbaseTemplate implements CouchbaseOperations {

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.convert;
package org.springframework.data.couchbase.core.convert;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.convert.ConversionService;

View File

@@ -20,13 +20,13 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.convert;
package org.springframework.data.couchbase.core.convert;
import com.couchbase.spring.core.mapping.ConvertedCouchbaseDocument;
import com.couchbase.spring.core.mapping.CouchbasePersistentEntity;
import com.couchbase.spring.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.convert.EntityConverter;
import org.springframework.data.convert.EntityReader;
import org.springframework.data.couchbase.core.mapping.ConvertedCouchbaseDocument;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
public interface CouchbaseConverter extends
EntityConverter<CouchbasePersistentEntity<?>,

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.convert;
package org.springframework.data.couchbase.core.convert;
import org.springframework.data.convert.EntityWriter;

View File

@@ -20,11 +20,8 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.convert;
package org.springframework.data.couchbase.core.convert;
import com.couchbase.spring.core.mapping.ConvertedCouchbaseDocument;
import com.couchbase.spring.core.mapping.CouchbasePersistentEntity;
import com.couchbase.spring.core.mapping.CouchbasePersistentProperty;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -38,6 +35,9 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.convert.support.ConversionServiceFactory;
import org.springframework.data.convert.EntityInstantiator;
import org.springframework.data.couchbase.core.mapping.ConvertedCouchbaseDocument;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mapping.model.BeanWrapper;
import org.springframework.data.mapping.model.MappingException;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
@@ -52,8 +52,8 @@ public class BasicCouchbasePersistentEntity<T>
}
public int getExpiry() {
com.couchbase.spring.core.mapping.Document annotation =
getType().getAnnotation(com.couchbase.spring.core.mapping.Document.class);
org.springframework.data.couchbase.core.mapping.Document annotation =
getType().getAnnotation(org.springframework.data.couchbase.core.mapping.Document.class);
if(annotation == null) {
return 0;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
@@ -70,8 +70,8 @@ public class BasicCouchbasePersistentProperty
*/
@Override
public String getFieldName() {
com.couchbase.spring.core.mapping.Field annotation = getField().
getAnnotation(com.couchbase.spring.core.mapping.Field.class);
org.springframework.data.couchbase.core.mapping.Field annotation = getField().
getAnnotation(org.springframework.data.couchbase.core.mapping.Field.class);
return annotation != null && StringUtils.hasText(annotation.value())
? annotation.value() : field.getName();

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import java.util.HashMap;
import java.util.Map;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import org.springframework.data.mapping.PersistentEntity;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import org.springframework.data.mapping.PersistentProperty;

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;

View File

@@ -2,7 +2,7 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.monitor;
package org.springframework.data.couchbase.monitor;
import com.couchbase.client.CouchbaseClient;
import org.springframework.web.client.RestTemplate;

View File

@@ -19,7 +19,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING
* IN THE SOFTWARE.
*/
package com.couchbase.spring.monitor;
package org.springframework.data.couchbase.monitor;
import com.couchbase.client.CouchbaseClient;
import org.springframework.jmx.export.annotation.ManagedAttribute;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.monitor;
package org.springframework.data.couchbase.monitor;
import com.couchbase.client.CouchbaseClient;
import org.springframework.http.converter.HttpMessageConverter;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.repository;
package org.springframework.data.couchbase.repository;
import org.springframework.data.repository.CrudRepository;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.repository.config;
package org.springframework.data.couchbase.repository.config;
import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport;
import org.springframework.data.repository.config.RepositoryConfigurationExtension;

View File

@@ -1,10 +1,10 @@
package com.couchbase.spring.repository.config;
package org.springframework.data.couchbase.repository.config;
import com.couchbase.spring.repository.support.CouchbaseRepositoryFactoryBean;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.data.config.ParsingUtils;
import org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactoryBean;
import org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource;
import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;
import org.springframework.data.repository.config.XmlRepositoryConfigurationSource;

View File

@@ -1,9 +1,9 @@
package com.couchbase.spring.repository.config;
package org.springframework.data.couchbase.repository.config;
import com.couchbase.spring.repository.support.CouchbaseRepositoryFactoryBean;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactoryBean;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.repository.query;
package org.springframework.data.couchbase.repository.query;
import org.springframework.data.repository.core.EntityInformation;

View File

@@ -1,10 +1,10 @@
package com.couchbase.spring.repository.support;
package org.springframework.data.couchbase.repository.support;
import com.couchbase.spring.core.CouchbaseOperations;
import com.couchbase.spring.core.mapping.CouchbasePersistentEntity;
import com.couchbase.spring.core.mapping.CouchbasePersistentProperty;
import com.couchbase.spring.repository.query.CouchbaseEntityInformation;
import org.springframework.data.couchbase.core.CouchbaseOperations;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mapping.model.MappingException;
import org.springframework.data.repository.core.RepositoryMetadata;

View File

@@ -1,7 +1,7 @@
package com.couchbase.spring.repository.support;
package org.springframework.data.couchbase.repository.support;
import com.couchbase.spring.core.CouchbaseOperations;
import org.springframework.data.couchbase.core.CouchbaseOperations;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;

View File

@@ -1,8 +1,8 @@
package com.couchbase.spring.repository.support;
package org.springframework.data.couchbase.repository.support;
import com.couchbase.spring.core.mapping.CouchbasePersistentEntity;
import com.couchbase.spring.core.mapping.CouchbasePersistentProperty;
import com.couchbase.spring.repository.query.CouchbaseEntityInformation;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation;
import org.springframework.data.mapping.model.BeanWrapper;
import org.springframework.data.repository.core.support.AbstractEntityInformation;

View File

@@ -1,8 +1,8 @@
package com.couchbase.spring.repository.support;
package org.springframework.data.couchbase.repository.support;
import com.couchbase.spring.core.CouchbaseOperations;
import com.couchbase.spring.repository.CouchbaseRepository;
import com.couchbase.spring.repository.query.CouchbaseEntityInformation;
import org.springframework.data.couchbase.core.CouchbaseOperations;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation;
import org.springframework.util.Assert;
import java.io.Serializable;

View File

@@ -1,6 +0,0 @@
package com.couchbase.spring.repository;
public interface UserRepository extends CouchbaseRepository<User, String>{
}

View File

@@ -20,10 +20,9 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring;
package org.springframework.data.couchbase;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.config.AbstractCouchbaseConfiguration;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
@@ -31,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration;
@Configuration
public class TestApplicationConfig extends AbstractCouchbaseConfiguration {

View File

@@ -20,15 +20,16 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.cache;
package org.springframework.data.couchbase.cache;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.TestApplicationConfig;
import java.util.HashMap;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.cache.CouchbaseCacheManager;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -20,15 +20,16 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.cache;
package org.springframework.data.couchbase.cache;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.TestApplicationConfig;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache.ValueWrapper;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.cache.CouchbaseCache;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -20,16 +20,17 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.config;
package org.springframework.data.couchbase.config;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.TestApplicationConfig;
import com.couchbase.spring.core.mapping.Document;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -20,11 +20,12 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.core.CouchbaseTemplate;
import org.springframework.data.couchbase.core.mapping.Field;
import com.couchbase.spring.core.mapping.Field;
/**
* Test class for persisting and loading from {@link CouchbaseTemplate}.

View File

@@ -20,18 +20,19 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core;
package org.springframework.data.couchbase.core;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.TestApplicationConfig;
import com.couchbase.spring.core.mapping.Document;
import com.couchbase.spring.core.mapping.Field;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.core.CouchbaseTemplate;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.data.couchbase.core.mapping.Field;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -20,13 +20,17 @@
* IN THE SOFTWARE.
*/
package com.couchbase.spring.core.mapping;
package org.springframework.data.couchbase.core.mapping;
import java.lang.reflect.Field;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.core.mapping.BasicCouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.BasicCouchbasePersistentProperty;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity;
import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty;
import org.springframework.data.mapping.model.SimpleTypeHolder;
import org.springframework.data.util.ClassTypeInformation;
import org.springframework.util.ReflectionUtils;
@@ -87,7 +91,7 @@ public class BasicCouchbasePersistentPropertyTest {
@Id
private String id;
@com.couchbase.spring.core.mapping.Field("foobar")
@org.springframework.data.couchbase.core.mapping.Field("foobar")
String name;
String description;

View File

@@ -1,11 +1,12 @@
package com.couchbase.spring.monitor;
package org.springframework.data.couchbase.monitor;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.TestApplicationConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.monitor.ClientInfo;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -1,11 +1,12 @@
package com.couchbase.spring.monitor;
package org.springframework.data.couchbase.monitor;
import com.couchbase.client.CouchbaseClient;
import com.couchbase.spring.TestApplicationConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.monitor.ClusterInfo;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -1,11 +1,11 @@
package com.couchbase.spring.repository;
package org.springframework.data.couchbase.repository;
import com.couchbase.spring.TestApplicationConfig;
import com.couchbase.spring.core.CouchbaseTemplate;
import com.couchbase.spring.repository.support.CouchbaseRepositoryFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.couchbase.TestApplicationConfig;
import org.springframework.data.couchbase.core.CouchbaseTemplate;
import org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactory;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View File

@@ -1,4 +1,4 @@
package com.couchbase.spring.repository;
package org.springframework.data.couchbase.repository;
import org.springframework.data.annotation.Id;

View File

@@ -0,0 +1,8 @@
package org.springframework.data.couchbase.repository;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
public interface UserRepository extends CouchbaseRepository<User, String>{
}