31 | * The field name can be different from the actual property name by using a custom annotation. 32 | */ 33 | String getFieldName(); 34 | 35 | boolean isExpirationProperty(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/CouchbaseStorable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping; 18 | 19 | /** 20 | * Marker Interface to identify either a {@link CouchbaseDocument} or a {@link CouchbaseList}. 21 | *
22 | * This interface will be extended in the future to refactor the needed infrastructure into the common interface.
23 | *
24 | * @author Michael Nitschinger
25 | */
26 | public interface CouchbaseStorable {}
27 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/mapping/Durability.java:
--------------------------------------------------------------------------------
1 | package org.springframework.data.couchbase.core.mapping;
2 |
3 | import com.couchbase.client.core.msg.kv.DurabilityLevel;
4 | import org.springframework.data.annotation.Persistent;
5 |
6 | import java.lang.annotation.*;
7 |
8 | /**
9 | * Durability annotation
10 | *
11 | * @author Tigran Babloyan
12 | */
13 | @Persistent
14 | @Inherited
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
17 | public @interface Durability {
18 | /**
19 | * The optional durabilityLevel for all mutating operations, allows the application to wait until this replication
20 | * (or persistence) is successful before proceeding
21 | */
22 | DurabilityLevel durabilityLevel() default DurabilityLevel.NONE;
23 |
24 | /**
25 | * Same as {@link #durabilityLevel()} but allows the actual value to be set using standard Spring property sources mechanism.
26 | * Only one might be set at the same time: either {@link #durabilityLevel()} or {@link #durabilityExpression()}.
27 | * Syntax is the same as for {@link org.springframework.core.env.Environment#resolveRequiredPlaceholders(String)}.
28 | *
29 | * SpEL is NOT supported.
30 | */
31 | String durabilityExpression() default "";
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/mapping/Expiration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-2025 the original author or authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.data.couchbase.core.mapping;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Annotation to define a field to be substituted for META().expiration in a query
26 | *
27 | * @author Michael Reiche
28 | */
29 | @Documented
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE })
32 | public @interface Expiration {
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/mapping/event/AfterDeleteEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-2025 the original author or authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.data.couchbase.core.mapping.event;
18 |
19 | /**
20 | * @author Michael Nitschinger
21 | */
22 | public class AfterDeleteEvent
4 | * The template provides lower level access to the underlying database and also serves as the foundation for
5 | * repositories. Any time a repository is too high-level for you needs chances are good that the templates will serve
6 | * you well.
7 | */
8 | package org.springframework.data.couchbase.core;
9 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/query/FetchType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2025 the original author or authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.data.couchbase.core.query;
18 |
19 | /**
20 | * Setting for specify when to fetch the associated entities
21 | *
22 | * @author Subhashni Balakrishnan
23 | */
24 | public enum FetchType {
25 | /**
26 | * Immediately fetch the associated entities
27 | */
28 | IMMEDIATE,
29 |
30 | /**
31 | * Lazily fetch the associated entities on access, the fetch happens only once
32 | */
33 | LAZY
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/query/HashSide.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2025 the original author or authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.data.couchbase.core.query;
18 |
19 | /**
20 | * Hash side to specify hash join. Here based on probe or build, the entity will be used to query or build the hash
21 | * table. The smaller data set side should be used to build to fit in memory.
22 | *
23 | * @author Subhashni Balakrishnan
24 | */
25 | public enum HashSide {
26 | /**
27 | * Hash join will not be used
28 | */
29 | NONE("none"),
30 |
31 | /**
32 | * Associated entity will be on the probe side of the hash table
33 | */
34 | PROBE("probe"),
35 |
36 | /**
37 | * Associated entity will be used to build the hash table for faster lookup
38 | */
39 | BUILD("build");
40 |
41 | private final String value;
42 |
43 | HashSide(String value) {
44 | this.value = value;
45 | }
46 |
47 | public String getValue() {
48 | return this.value;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/query/N1qlPrimaryIndexed.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-2025 the original author or authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.data.couchbase.core.query;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | import org.springframework.data.couchbase.repository.CouchbaseRepository;
25 |
26 | /**
27 | * This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework
28 | * should ensure a N1QL Primary Index is present on the repository's associated bucket when the repository is created.
29 | *
30 | * @author Simon Baslé
31 | */
32 | @Deprecated
33 | @Target({ElementType.TYPE})
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface N1qlPrimaryIndexed {
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/query/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This package contains annotations and classes relative to querying with Couchbase (whether through views or N1QL) and
3 | * the associated indexes.
4 | */
5 | package org.springframework.data.couchbase.core.query;
6 |
--------------------------------------------------------------------------------
/src/main/java/org/springframework/data/couchbase/core/support/AnyId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-2025 the original author or authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.data.couchbase.core.support;
17 |
18 | import java.util.Collection;
19 |
20 | /**
21 | * A common interface for those that support one(T), all(Collection<T>)
22 | *
23 | * @author Michael Reiche
24 | * @param