@@ -33,118 +33,120 @@ public interface CouchbaseOperations {
33
33
34
34
/**
35
35
* Save the given object.
36
- *
36
+ * <p/>
37
37
* <p>When the document already exists (specified by its unique id), then it will be overriden. Otherwise it will be
38
38
* created.</p>
39
39
*
40
40
* @param objectToSave the object to store in the bucket.
41
41
*/
42
42
void save (Object objectToSave );
43
-
43
+
44
44
/**
45
45
* Save a list of objects.
46
- *
46
+ * <p/>
47
47
* <p>When one of the documents already exists (specified by its unique id), then it will be overriden. Otherwise it
48
48
* will be created.</p>
49
49
*
50
50
* @param batchToSave the list of objects to store in the bucket.
51
51
*/
52
- void save (Collection <? extends Object > batchToSave );
53
-
52
+ void save (Collection <?> batchToSave );
53
+
54
54
/**
55
55
* Insert the given object.
56
- *
56
+ * <p/>
57
57
* <p>When the document already exists (specified by its unique id), then it will not be overriden. Use the
58
58
* {@link CouchbaseOperations#save} method for this task.</p>
59
59
*
60
60
* @param objectToSave the object to add to the bucket.
61
61
*/
62
62
void insert (Object objectToSave );
63
-
63
+
64
64
/**
65
65
* Insert a list of objects.
66
- *
66
+ * <p/>
67
67
* <p>When one of the documents already exists (specified by its unique id), then it will not be overriden. Use the
68
68
* {@link CouchbaseOperations#save} method for this.</p>
69
69
*
70
70
* @param batchToSave the list of objects to add to the bucket.
71
71
*/
72
- void insert (Collection <? extends Object > batchToSave );
72
+ void insert (Collection <?> batchToSave );
73
73
74
74
/**
75
75
* Update the given object.
76
- *
76
+ * <p/>
77
77
* <p>When the document does not exist (specified by its unique id) it will not be created. Use the
78
78
* {@link CouchbaseOperations#save} method for this.</p>
79
79
*
80
80
* @param objectToSave the object to add to the bucket.
81
81
*/
82
82
void update (Object objectToSave );
83
-
83
+
84
84
/**
85
85
* Insert a list of objects.
86
- *
86
+ * <p/>
87
87
* <p>If one of the documents does not exist (specified by its unique id), then it will not be created. Use the
88
88
* {@link CouchbaseOperations#save} method for this.</p>
89
89
*
90
90
* @param batchToSave the list of objects to add to the bucket.
91
91
*/
92
- void update (Collection <? extends Object > batchToSave );
93
-
92
+ void update (Collection <?> batchToSave );
93
+
94
94
/**
95
95
* Find an object by its given Id and map it to the corresponding entity.
96
96
*
97
97
* @param id the unique ID of the document.
98
98
* @param entityClass the entity to map to.
99
+ *
99
100
* @return returns the found object or null otherwise.
100
101
*/
101
102
<T > T findById (String id , Class <T > entityClass );
102
103
103
104
/**
104
105
* Query a View for a list of documents of type T.
105
- *
106
+ * <p/>
106
107
* <p>There is no need to {@link Query#setIncludeDocs(boolean)} explicitely, because it will be set to true all the
107
108
* time. It is valid to pass in a empty constructed {@link Query} object.</p>
108
- *
109
+ * <p/>
109
110
* <p>This method does not work with reduced views, because they by design do not contain references to original
110
111
* objects. Use the provided {@link #queryView} method for more flexibility and direct access.</p>
111
112
*
112
113
* @param design the name of the design document.
113
114
* @param view the name of the viewName.
114
115
* @param query the Query object to customize the viewName query.
115
116
* @param entityClass the entity to map to.
117
+ *
116
118
* @return the converted collection
117
119
*/
118
120
<T > List <T > findByView (String design , String view , Query query , Class <T > entityClass );
119
121
120
122
121
123
/**
122
124
* Query a View with direct access to the {@link ViewResponse}.
123
- *
124
125
* <p>This method is available to ease the working with views by still wrapping exceptions into the Spring
125
126
* infrastructure.</p>
126
- *
127
127
* <p>It is especially needed if you want to run reduced viewName queries, because they can't be mapped onto entities
128
128
* directly.</p>
129
129
*
130
130
* @param design the name of the designDocument document.
131
131
* @param view the name of the viewName.
132
132
* @param query the Query object to customize the viewName query.
133
- * @return
133
+ *
134
+ * @return ViewResponse containing the results of the query.
134
135
*/
135
136
ViewResponse queryView (String design , String view , Query query );
136
137
137
138
/**
138
139
* Checks if the given document exists.
139
140
*
140
141
* @param id the unique ID of the document.
142
+ *
141
143
* @return whether the document could be found or not.
142
144
*/
143
145
boolean exists (String id );
144
146
145
147
/**
146
148
* Remove the given object from the bucket by id.
147
- *
149
+ * <p/>
148
150
* If the object is a String, it will be treated as the document key
149
151
* directly.
150
152
*
@@ -157,22 +159,24 @@ public interface CouchbaseOperations {
157
159
*
158
160
* @param batchToRemove the list of Objects to remove.
159
161
*/
160
- void remove (Collection <? extends Object > batchToRemove );
162
+ void remove (Collection <?> batchToRemove );
161
163
162
164
/**
163
165
* Executes a BucketCallback translating any exceptions as necessary.
164
- *
166
+ * <p/>
165
167
* Allows for returning a result object, that is a domain object or a collection of domain objects.
166
168
*
167
169
* @param action the action to execute in the callback.
168
170
* @param <T> the return type.
169
- * @return
171
+ *
172
+ * @return the return type.
170
173
*/
171
174
<T > T execute (BucketCallback <T > action );
172
175
173
176
/**
174
177
* Returns the underlying {@link CouchbaseConverter}.
175
- * @return
178
+ *
179
+ * @return CouchbaseConverter.
176
180
*/
177
181
CouchbaseConverter getConverter ();
178
182
0 commit comments