DATACOUCH-73 - Prepare 1.0.0.RELEASE.
Removed obsolete dependency declarations. Fixed syntax highlighting for reference documentation. Include general Spring Data repositories documentation as well as namespace and keyword reference as appendix.
This commit is contained in:
21
pom.xml
21
pom.xml
@@ -54,20 +54,6 @@
|
||||
<version>${couchbase}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>2.2.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
@@ -110,13 +96,6 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-all</artifactId>
|
||||
<version>${hamcrest}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<example>
|
||||
<title>Including the dependency through maven</title>
|
||||
|
||||
<programlisting lang="xml"><![CDATA[
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-couchbase</artifactId>
|
||||
@@ -38,7 +38,7 @@
|
||||
<example>
|
||||
<title>Using a snapshot version</title>
|
||||
|
||||
<programlisting lang="xml"><![CDATA[
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-couchbase</artifactId>
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
<example>
|
||||
<title>Extending the <code>AbstractCouchbaseConfiguration</code></title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Configuration
|
||||
public class Config extends AbstractCouchbaseConfiguration {
|
||||
@Override
|
||||
@@ -115,7 +115,7 @@ public class Config extends AbstractCouchbaseConfiguration {
|
||||
|
||||
<example>
|
||||
<title>Basic XML configuration</title>
|
||||
<programlisting lang="xml"><![CDATA[
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<example>
|
||||
<title>A simple Document with Fields</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.couchbase.core.mapping.Document;
|
||||
import org.springframework.data.couchbase.core.mapping.Field;
|
||||
@@ -140,7 +140,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>A Document with Map and List</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Document
|
||||
public class User {
|
||||
|
||||
@@ -167,7 +167,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>A Document with Map and List - JSON</title>
|
||||
<programlisting lang="json"><![CDATA[
|
||||
<programlisting language="json"><![CDATA[
|
||||
{
|
||||
"_class": "foo.User",
|
||||
"childrenAges": {
|
||||
@@ -189,7 +189,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>A Document with composed objects</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Document
|
||||
public class User {
|
||||
|
||||
@@ -227,7 +227,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>A Document with composed objects - JSON</title>
|
||||
<programlisting lang="json"><![CDATA[
|
||||
<programlisting language="json"><![CDATA[
|
||||
{
|
||||
"_class": "foo.User",
|
||||
"children": [
|
||||
@@ -257,7 +257,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>A Document with Date and Calendar</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Document
|
||||
public class BlogPost {
|
||||
|
||||
@@ -288,7 +288,7 @@ public class BlogPost {
|
||||
|
||||
<example>
|
||||
<title>A Document with Date and Calendar - JSON</title>
|
||||
<programlisting lang="json"><![CDATA[
|
||||
<programlisting language="json"><![CDATA[
|
||||
{
|
||||
"title": "a blog post title",
|
||||
"_class": "foo.BlogPost",
|
||||
@@ -305,7 +305,7 @@ public class BlogPost {
|
||||
|
||||
<example>
|
||||
<title>Custom Converters</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Override
|
||||
public CustomConversions customConversions() {
|
||||
return new CustomConversions(Arrays.asList(FooToBarConverter.INSTANCE, BarToFooConverter.INSTANCE));
|
||||
@@ -374,7 +374,7 @@ public static enum BarToFooConverter implements Converter<Bar, Foo> {
|
||||
|
||||
<example>
|
||||
<title>A Document with optimistic locking.</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Document
|
||||
public class User {
|
||||
|
||||
@@ -407,7 +407,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>Validation dependencies</title>
|
||||
<programlisting lang="xml"><![CDATA[
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
@@ -423,7 +423,7 @@ public class User {
|
||||
|
||||
<example>
|
||||
<title>Validation beans</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Bean
|
||||
public LocalValidatorFactoryBean validator() {
|
||||
return new LocalValidatorFactoryBean();
|
||||
@@ -441,7 +441,7 @@ public ValidatingCouchbaseEventListener validationEventListener() {
|
||||
|
||||
<example>
|
||||
<title>Sample Validation Annotation</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Size(min = 10)
|
||||
@Field
|
||||
private String name;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<bookinfo>
|
||||
<title>Spring Data Couchbase - Reference Documentation</title>
|
||||
|
||||
<releaseinfo>version;</releaseinfo>
|
||||
<releaseinfo>&version;</releaseinfo>
|
||||
|
||||
<authorgroup>
|
||||
<author>
|
||||
@@ -21,6 +21,19 @@
|
||||
|
||||
<email>michael.nitschinger@couchbase.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Oliver</firstname>
|
||||
|
||||
<surname>Gierke</surname>
|
||||
|
||||
<affiliation>
|
||||
<jobtitle>Spring Data Project Lead</jobtitle>
|
||||
|
||||
<orgname>Pivotal Software, Inc.</orgname>
|
||||
</affiliation>
|
||||
|
||||
<email>ogierke@gopivotal.com</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<legalnotice>
|
||||
@@ -47,9 +60,26 @@
|
||||
<title>Reference Documentation</title>
|
||||
<xi:include href="configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="entity.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="https://raw.github.com/SpringSource/spring-data-commons/1.7.1.RELEASE/src/docbkx/repositories.xml"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:fallback href="../../../spring-data-commons/src/docbkx/repositories.xml" />
|
||||
</xi:include>
|
||||
<xi:include href="repository.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="template.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="caching.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
</part>
|
||||
|
||||
<part id="appendix">
|
||||
<title>Appendix</title>
|
||||
<xi:include href="https://raw.github.com/SpringSource/spring-data-commons/1.7.1.RELEASE/src/docbkx/repository-namespace-reference.xml"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:fallback href="../../../spring-data-commons/src/docbkx/repository-namespace-reference.xml" />
|
||||
</xi:include>
|
||||
|
||||
<xi:include href="https://raw.github.com/SpringSource/spring-data-commons/1.7.1.RELEASE/src/docbkx/repository-query-keywords-reference.xml"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:fallback href="../../../spring-data-commons/src/docbkx/repository-query-keywords-reference.xml" />
|
||||
</xi:include>
|
||||
</part>
|
||||
|
||||
</book>
|
||||
@@ -2,14 +2,14 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
||||
<chapter id="couchbase.repository">
|
||||
<title>Repositories</title>
|
||||
<title>Couchbase repositories</title>
|
||||
|
||||
<abstract>
|
||||
<para>The goal of Spring Data repository abstraction is to significantly reduce the amount of boilerplate code
|
||||
required to implement data access layers for various persistence stores.</para>
|
||||
</abstract>
|
||||
|
||||
<section id ="repository.configuration">
|
||||
<section id ="couchbase.repository.configuration">
|
||||
<title>Configuration</title>
|
||||
|
||||
<para>While support for repositories is always present, you need to enable them in general or for a specific
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<example>
|
||||
<title>Annotation-Based Repository Setup</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Configuration
|
||||
@EnableCouchbaseRepositories(basePackages = {"com.couchbase.example.repos"})
|
||||
public class Config extends AbstractCouchbaseConfiguration {
|
||||
@@ -32,14 +32,14 @@ public class Config extends AbstractCouchbaseConfiguration {
|
||||
|
||||
<example>
|
||||
<title>XML-Based Repository Setup</title>
|
||||
<programlisting lang="xml"><![CDATA[
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<couchbase:repositories base-package="com.couchbase.example.repos" />
|
||||
]]></programlisting>
|
||||
</example>
|
||||
|
||||
</section>
|
||||
|
||||
<section id ="repository.usage">
|
||||
<section id ="couchbase.repository.usage">
|
||||
<title>Usage</title>
|
||||
|
||||
<para>In the simplest case, your repository will extend the <code>CrudRepository<T, String></code>, where
|
||||
@@ -47,7 +47,7 @@ public class Config extends AbstractCouchbaseConfiguration {
|
||||
|
||||
<example>
|
||||
<title>A User repository</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
public interface UserRepository extends CrudRepository<User, String> {
|
||||
@@ -135,7 +135,7 @@ public interface UserRepository extends CrudRepository<User, String> {
|
||||
|
||||
<example>
|
||||
<title>An extended User repository</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
public interface UserRepository extends CrudRepository<User, String> {
|
||||
|
||||
List<User> findAllAdmins();
|
||||
@@ -150,7 +150,7 @@ public interface UserRepository extends CrudRepository<User, String> {
|
||||
a yet unknown parameter, let's cover that next.</para>
|
||||
</section>
|
||||
|
||||
<section id="repository.views">
|
||||
<section id="couchbase.repository.views">
|
||||
<title>Backing Views</title>
|
||||
|
||||
<para>As a rule of thumb, all repository access methods which are not "by a specific key" require a backing view
|
||||
@@ -168,7 +168,7 @@ public interface UserRepository extends CrudRepository<User, String> {
|
||||
|
||||
<example>
|
||||
<title>The all view map function</title>
|
||||
<programlisting lang="javascript"><![CDATA[
|
||||
<programlisting language="javascript"><![CDATA[
|
||||
// do not forget the _count reduce function!
|
||||
function (doc, meta) {
|
||||
if (doc._class == "namespace.to.entity.User") {
|
||||
@@ -195,7 +195,7 @@ function (doc, meta) {
|
||||
|
||||
<example>
|
||||
<title>A custom view map function</title>
|
||||
<programlisting lang="javascript"><![CDATA[
|
||||
<programlisting language="javascript"><![CDATA[
|
||||
function (doc, meta) {
|
||||
if (doc._class == "namespace.to.entity.User" && doc.isAdmin) {
|
||||
emit(null, null);
|
||||
@@ -210,7 +210,7 @@ function (doc, meta) {
|
||||
|
||||
<example>
|
||||
<title>A parameterized view map function</title>
|
||||
<programlisting lang="javascript"><![CDATA[
|
||||
<programlisting language="javascript"><![CDATA[
|
||||
function (doc, meta) {
|
||||
if (doc._class == "namespace.to.entity.User") {
|
||||
emit(doc.firstname, null);
|
||||
@@ -224,7 +224,7 @@ function (doc, meta) {
|
||||
|
||||
<example>
|
||||
<title>Query a repository method with custom params.</title>
|
||||
<programlisting lang="java"><![CDATA[
|
||||
<programlisting language="java"><![CDATA[
|
||||
// Load the bean, or @Autowire it
|
||||
UserRepository repo = ctx.getBean(UserRepository.class);
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ Release Notes - Spring Data Couchbase - Version 1.0 RC1 - 2014-02-06
|
||||
* [DATACOUCH-30] - ObjectMapper configuration must be supported
|
||||
* [DATACOUCH-44] - Not consistent unit tests
|
||||
* [DATACOUCH-47] - Connecting to multiple buckets fails
|
||||
* [DATACOUCH-51] - update(java.util.Collection) adds new document object
|
||||
* [DATACOUCH-51] - update(java.util.Collection) adds new document object
|
||||
* [DATACOUCH-52] - CouchbaseCacheManager does not shutdown couchbase connections
|
||||
* [DATACOUCH-53] - NPE on CouchbaseCache puting null
|
||||
* [DATACOUCH-53] - NPE on CouchbaseCache puting null
|
||||
* [DATACOUCH-58] - Allow null values for List elements and Map values
|
||||
|
||||
** Improvement
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Spring Data Couchbase 1.0.0.RELEASE
|
||||
Copyright (c) [2013-2014] Couchbase / Pivotal Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
You may not use this product except in compliance with the License.
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
You may not use this product except in compliance with the License.
|
||||
|
||||
This product may include a number of subcomponents with
|
||||
separate copyright notices and license terms. Your use of the source
|
||||
code for the these subcomponents is subject to the terms and
|
||||
conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-SymbolicName: org.springframework.data.couchbase
|
||||
Bundle-Name: ${project.name}
|
||||
Bundle-Vendor: Pivotal
|
||||
Bundle-Vendor: Pivotal Software, Inc.
|
||||
Bundle-Version: ${project.version}
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Export-Template:
|
||||
Export-Template:
|
||||
org.springframework.data.couchbase.*;version="${project.version}"
|
||||
Import-Template:
|
||||
com.couchbase.client.*;version="${couchbase:[=.=.=,+1.0.0)}",
|
||||
|
||||
Reference in New Issue
Block a user