You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All entities should be annotated with the `@Document` annotation.
11
+
All entities should be annotated with the `@Document` annotation, but it is not a requirement.
12
12
13
-
Also, every field in the entity should be annotated with the `@Field` annotation from the Couchbase SDK. While this is - strictly speaking - optional, it helps to reduce edge cases and clearly shows the intent and design of the entity.
14
-
It can also be used to store the field under a different name.
13
+
Also, every field in the entity should be annotated with the `@Field` annotation. While this is - strictly speaking -
14
+
optional, it helps to reduce edge cases and clearly shows the intent and design of the entity. It can also be used to
15
+
store the field under a different name.
15
16
16
-
There is also a special `@Id` annotation which needs to be always in place.
17
-
Best practice is to also name the property `id`.
18
-
19
-
TIP: Both the Couchbase SDK and Spring Data define their own `@Id` annotation.
20
-
Either can be used (the Spring Data one will get priority if both are found on different fields).
17
+
There is also a special `@Id` annotation which needs to be always in place. Best practice is to also name the property
Copy file name to clipboardExpand all lines: src/main/asciidoc/migrating.adoc
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,19 @@ The new SDK still has an environment that is used to configure it, so you can ov
18
18
19
19
For more information, see <<couchbase.configuration>>.
20
20
21
+
[[couchbase.migrating.entities]]
22
+
== Entities
23
+
How to deal with entities has not changed, although since the SDK now does not ship annotations anymore only Spring-Data related annotations are supported.
24
+
25
+
Specifically:
26
+
27
+
- `com.couchbase.client.java.repository.annotation.Id` became `import org.springframework.data.annotation.Id`
28
+
- `com.couchbase.client.java.repository.annotation.Field` became `import org.springframework.data.couchbase.core.mapping.Field`
29
+
30
+
The `org.springframework.data.couchbase.core.mapping.Document` annotation stayed the same.
0 commit comments