Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add readonly and watch attributes to CriteriaRepository
- Loading branch information
1 parent
a384c27
commit 3713781
Showing
10 changed files
with
217 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
criteria/common/src/org/immutables/criteria/adapter/Operations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,77 @@ | |||
/* | |||
* Copyright 2019 Immutables Authors and Contributors | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
|
|||
package org.immutables.criteria.adapter; | |||
|
|||
import org.immutables.criteria.DocumentCriteria; | |||
import org.immutables.criteria.Repository; | |||
import org.immutables.value.Value; | |||
|
|||
import java.util.List; | |||
import java.util.OptionalLong; | |||
|
|||
/** | |||
* List of default operations which can be executed on the backend | |||
*/ | |||
public final class Operations { | |||
|
|||
private Operations() {} | |||
|
|||
/** | |||
* Query sent to a backend | |||
*/ | |||
@Value.Immutable | |||
public interface Query<T> extends Backend.Operation<T> { | |||
|
|||
@Value.Parameter | |||
DocumentCriteria<?> criteria(); | |||
|
|||
@Value.Parameter | |||
Class<T> returnType(); | |||
|
|||
OptionalLong limit(); | |||
|
|||
OptionalLong offset(); | |||
} | |||
|
|||
/** | |||
* Insert list of "documents" | |||
*/ | |||
@Value.Immutable | |||
public interface Insert extends Backend.Operation<Repository.Success> { | |||
@Value.Parameter | |||
List<?> entities(); | |||
} | |||
|
|||
/** | |||
* Delete documents using some criteria | |||
*/ | |||
@Value.Immutable | |||
public interface Delete extends Backend.Operation<Repository.Success> { | |||
@Value.Parameter | |||
DocumentCriteria<?> criteria(); | |||
|
|||
} | |||
|
|||
@Value.Immutable | |||
public interface Watch<T> extends Backend.Operation<T> { | |||
@Value.Parameter | |||
DocumentCriteria<?> criteria(); | |||
|
|||
} | |||
|
|||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters