Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace ViewQuery annotation with CouchbaseView in readme #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ import java.util.List;

public interface DeviceAccessor extends GenericAccessor<Device> {

@ViewQuery("/^DEVICE/.test(meta.id)")
@CouchbaseView("/^DEVICE/.test(meta.id)")
public List<Device> findAll();

}
```

The `findall()` method will be autogenerated. The `@ViewQuery` annotation will generate a Couchbase Design Document called DEVICE with a view called findAll like so:
The `findall()` method will be autogenerated. The `@CouchbaseView` annotation will generate a Couchbase Design Document called DEVICE with a view called findAll like so:

```javascript
function (doc, meta) {
Expand All @@ -212,7 +212,7 @@ function (doc, meta) {
}
```

The emit statement can be controlled as well, `emit(meta.id, null)` is the default. The following annotation will generate a view that emits full documents: `@ViewQuery("/^DEVICE/.test(meta.id)", emit = "emit(meta.id, doc)")`. Note that the name of the Design Document will be your model class `.toUpperCase()`.
The emit statement can be controlled as well, `emit(meta.id, null)` is the default. The following annotation will generate a view that emits full documents: `@CouchbaseView("/^DEVICE/.test(meta.id)", emit = "emit(meta.id, doc)")`. Note that the name of the Design Document will be your model class `.toUpperCase()`.

The extended `GenericAccessor<Device>` interface has the following contract, all methods will be automatically implemented:

Expand Down