DATACOUCH-103 - Polished reference documentation.

This commit is contained in:
Oliver Gierke
2014-08-22 15:40:17 +02:00
parent 014a7556c9
commit 3c5ff86eab
6 changed files with 37 additions and 30 deletions

View File

@@ -28,7 +28,7 @@ public class Config extends AbstractCouchbaseConfiguration {
instances.put("persistent", couchbaseClient());
return new CouchbaseCacheManager(instances);
}
}
}
----
====
@@ -47,8 +47,8 @@ public String simulateLongRun(long time) {
} catch(Exception ex) {
System.out.println("This shouldnt happen...");
}
return "Ive slept " + time + " miliseconds.;
}
return "I've slept " + time + " miliseconds.;
}
----
====

View File

@@ -37,7 +37,7 @@ You can also grab snapshots from the http://repo.spring.io/libs-snapshot[spring
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>
----
====
@@ -58,6 +58,7 @@ Please make sure to have cglib support in the classpath so that the annotation b
@Configuration
public class Config extends AbstractCouchbaseConfiguration {
@Override
protected List<String> bootstrapHosts() {
return Collections.singletonList("127.0.0.1");
@@ -72,7 +73,7 @@ public class Config extends AbstractCouchbaseConfiguration {
protected String getBucketPassword() {
return "";
}
}
}
----
====
@@ -103,7 +104,7 @@ The library provides a custom namespace that you can use in your XML configurati
http://www.springframework.org/schema/data/couchbase/spring-couchbase.xsd">
<couchbase:couchbase bucket="beer-sample" password="" host="127.0.0.1" />
</beans:beans>
----
====

View File

@@ -14,7 +14,6 @@ There is also a special `@Id` annotation which needs to be always in place. Best
====
[source,java]
----
import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.data.couchbase.core.mapping.Field;
@@ -49,7 +48,7 @@ public class User {
return lastname;
}
}
----
====
@@ -125,7 +124,7 @@ public class User {
this.childrenAges = childrenAges;
}
}
}
----
====
@@ -147,7 +146,7 @@ Storing a user with some sample data could look like this as a JSON representati
"Bar",
"Baz"
]
}
}
----
====
@@ -186,7 +185,7 @@ public class User {
}
}
}
----
====
@@ -214,7 +213,7 @@ A populated object can look like:
"Bar",
"Baz"
]
}
}
----
====
@@ -246,7 +245,7 @@ public class BlogPost {
this.title = title;
}
}
}
----
====
@@ -261,7 +260,7 @@ A populated object can look like:
"_class": "foo.BlogPost",
"updated": 1394610843,
"created": 1394610843897
}
}
----
====
@@ -296,7 +295,7 @@ public static enum BarToFooConverter implements Converter<Bar, Foo> {
return /* do your conversion here */;
}
}
}
----
====
@@ -324,7 +323,7 @@ public class User {
private long version;
// constructor, getters, setters...
}
}
----
====

View File

@@ -1,31 +1,38 @@
= Spring Data Couchbase - Reference Documentation
Michael Nitschinger, Oliver Gierke
:revnumber: {version}
:revdate: {localdate}
:toc:
:spring-data-commons-docs: https://raw.githubusercontent.com/spring-projects/spring-data-commons/issue/DATACMNS-551/src/main/asciidoc
:toc-placement!:
:spring-data-commons-docs: https://raw.githubusercontent.com/spring-projects/spring-data-commons/master/src/main/asciidoc
{version}
(C) 2014 The original author(s).
(C) 2014 The original author(s)
NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
NOTE: _Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically._
toc::[]
include::preface.adoc[]
[[reference]]
= Reference Documentation
:leveloffset: 1
:leveloffset: +1
include::configuration.adoc[]
include::entity.adoc[]
include::{spring-data-commons-docs}/repositories.adoc[]
include::repository.adoc[]
include::template.adoc[]
include::caching.adoc[]
:leveloffset: -1
:leveloffset: 0
:numbered!:
[[appendix]]
= Appendix
:numbered!:
:leveloffset: +1
include::{spring-data-commons-docs}/repository-namespace-reference.adoc[]
include::{spring-data-commons-docs}/repository-populator-namespace-reference.adoc[]
include::{spring-data-commons-docs}/repository-query-keywords-reference.adoc[]
:leveloffset: -1

View File

@@ -1,15 +1,15 @@
[preface]
[[couchbase.preface]]
= Preface
This reference documentation describes the general usage of the Spring Data Couchbase library.
[[metadata]]
[preface]
== Project Information
* Version control - `git://github.com/spring-projects/spring-data-couchbase.git`
* Version control - https://github.com/spring-projects/spring-data-couchbase
* Bugtracker - https://jira.springsource.org/browse/DATACOUCH
* Release repository - http://repo.spring.io/libs-release
* Milestone repository - http://repo.spring.io/libs-milestone
* Snapshot repository - http://repo.spring.io/libs-snapshot
* Release repository - https://repo.spring.io/libs-release
* Milestone repository - https://repo.spring.io/libs-milestone
* Snapshot repository - https://repo.spring.io/libs-snapshot

View File

@@ -1,10 +1,10 @@
[[couchbase.template]]
= Template & direct Operations
= Template & direct operations
The template provides lower level access to the underlying database and also serves as the foundation for repositories. Any time a repository is too high-level for you needs chances are good that the templates will serve you well.
[[template.ops]]
== Supported Operations
== Supported operations
The template can be accessed through the `couchbaseTemplate` bean out of your context. Once you've got a reference to it, you can run all kinds of operations against it. Other than through a repository, in a template you need to always specify the target entity type which you want to get converted.