Skip to content

Commit

Permalink
Duplicate interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jul 20, 2021
1 parent 41c5a65 commit 9d4ccc5
Show file tree
Hide file tree
Showing 20 changed files with 170 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
* Interface representing an update query.
*
* Use one of its methods to perform the update query.
*
* @deprecated use {@link io.quarkus.mongodb.panache.common.PanacheUpdate} instead.
*/
@Deprecated(forRemoval = true, since = "2.1.0")
public interface PanacheUpdate {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package io.quarkus.mongodb.panache.common;

import java.util.Map;

import io.quarkus.panache.common.Parameters;

/**
* Interface representing an update query.
*
* Use one of its methods to perform the update query.
*/
public interface PanacheUpdate extends io.quarkus.mongodb.panache.PanacheUpdate {

/**
* Execute the update query with the update document.
*
* @param query a {@link io.quarkus.mongodb.panache query string}
* @param params params optional sequence of indexed parameters
* @return the number of entities updated.
*/
public long where(String query, Object... params);

/**
* Execute the update query with the update document.
*
* @param query a {@link io.quarkus.mongodb.panache query string}
* @param params {@link Map} of named parameters
* @return the number of entities updated.
*/
public long where(String query, Map<String, Object> params);

/**
* Execute the update query with the update document.
*
* @param query a {@link io.quarkus.mongodb.panache query string}
* @param params {@link Parameters} of named parameters
* @return the number of entities updated.
*/
public long where(String query, Parameters params);

/**
* Execute an update on all documents with the update document.
*
* @return the number of entities updated.
*/
public long all();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package io.quarkus.mongodb.panache.common.reactive;

import java.util.Map;

import io.quarkus.panache.common.Parameters;
import io.smallrye.mutiny.Uni;

/**
* Interface representing an update query.
*
* Use one of its methods to perform the update query.
*/
public interface ReactivePanacheUpdate extends io.quarkus.mongodb.panache.reactive.ReactivePanacheUpdate {
/**
* Execute the update query with the update document.
*
* @param query a {@link io.quarkus.mongodb.panache query string}
* @param params params optional sequence of indexed parameters
* @return the number of entities updated.
*/
public Uni<Long> where(String query, Object... params);

/**
* Execute the update query with the update document.
*
* @param query a {@link io.quarkus.mongodb.panache query string}
* @param params {@link Map} of named parameters
* @return the number of entities updated.
*/
public Uni<Long> where(String query, Map<String, Object> params);

/**
* Execute the update query with the update document.
*
* @param query a {@link io.quarkus.mongodb.panache query string}
* @param params {@link Parameters} of named parameters
* @return the number of entities updated.
*/
public Uni<Long> where(String query, Parameters params);

/**
* Execute an update on all documents with the update document.
*
* @return the number of entities updated.
*/
public Uni<Long> all();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.bson.BsonDocument;
import org.bson.conversions.Bson;

import io.quarkus.mongodb.panache.reactive.ReactivePanacheUpdate;
import io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate;
import io.quarkus.mongodb.reactive.ReactiveMongoCollection;
import io.quarkus.panache.common.Parameters;
import io.smallrye.mutiny.Uni;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.mongodb.client.ClientSession;
import com.mongodb.client.MongoCollection;

import io.quarkus.mongodb.panache.PanacheUpdate;
import io.quarkus.mongodb.panache.common.PanacheUpdate;
import io.quarkus.panache.common.Parameters;

public class PanacheUpdateImpl implements PanacheUpdate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* Interface representing an update query.
*
* Use one of its methods to perform the update query.
*
* @deprecated use {@link io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate} instead.
*/
@Deprecated(forRemoval = true, since = "2.1.0")
public interface ReactivePanacheUpdate {
/**
* Execute the update query with the update document.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkus.mongodb.panache.kotlin.deployment;

import io.quarkus.mongodb.panache.PanacheUpdate;
import io.quarkus.mongodb.panache.common.PanacheUpdate;
import io.quarkus.mongodb.panache.kotlin.PanacheMongoCompanion;
import io.quarkus.mongodb.panache.kotlin.PanacheMongoCompanionBase;
import io.quarkus.mongodb.panache.kotlin.PanacheMongoEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.mongodb.panache.kotlin.deployment;

import io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate;
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheMongoCompanion;
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheMongoCompanionBase;
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheMongoEntity;
Expand All @@ -8,7 +9,6 @@
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheMongoRepositoryBase;
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheQuery;
import io.quarkus.mongodb.panache.kotlin.reactive.runtime.KotlinReactiveMongoOperations;
import io.quarkus.mongodb.panache.reactive.ReactivePanacheUpdate;
import io.quarkus.panache.common.deployment.ByteCodeType;
import io.quarkus.panache.common.deployment.TypeBundle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,45 +645,45 @@ interface PanacheMongoCompanionBase<Entity : PanacheMongoEntityBase, Id: Any> {

/**
* Update all entities of this type using the given update document with optional indexed parameters.
* The returned [PanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.PanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params optional sequence of indexed parameters
* @return a new [PanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.PanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, vararg params: Any?): PanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, vararg params: Any?): io.quarkus.mongodb.panache.common.PanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document with named parameters.
* The returned [PanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.PanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
*
* @param params map of named parameters
* @return a new [PanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.PanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Map<String, Any?>): PanacheUpdate =
fun update(update: String, params: Map<String, Any?>): io.quarkus.mongodb.panache.common.PanacheUpdate =
throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [PanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.PanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
*
* @param params [Parameters] of named parameters
* @return a new [PanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.PanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Parameters): PanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, params: Parameters): io.quarkus.mongodb.panache.common.PanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Allow to access the underlying Mongo Collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,43 +676,43 @@ interface PanacheMongoRepositoryBase<Entity: Any, Id: Any> {

/**
* Update all entities of this type by the given update document, with optional indexed parameters.
* The returned [PanacheUpdate] object will allow to restrict on which documents the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.PanacheUpdate] object will allow to restrict on which documents the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params optional sequence of indexed parameters
* @return a new [PanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.PanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, vararg params: Any?): PanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, vararg params: Any?): io.quarkus.mongodb.panache.common.PanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [PanacheUpdate] object will allow to restrict on which documents the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.PanacheUpdate] object will allow to restrict on which documents the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params [Map] of named parameters
* @return a new [PanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.PanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Map<String, Any?>): PanacheUpdate =
fun update(update: String, params: Map<String, Any?>): io.quarkus.mongodb.panache.common.PanacheUpdate =
throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [PanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.PanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params [Parameters] of named parameters
* @return a new [PanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.PanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Parameters): PanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, params: Parameters): io.quarkus.mongodb.panache.common.PanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Allow to access the underlying Mongo Collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,43 +718,43 @@ interface ReactivePanacheMongoCompanionBase<Entity : ReactivePanacheMongoEntityB

/**
* Update all entities of this type by the given update document, with optional indexed parameters.
* The returned [ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params optional sequence of indexed parameters
* @return a new [ReactivePanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] instance for the given update document
* @see [update]
* @see [update]
*/
@GenerateBridge
fun update(update: String, vararg params: Any?): ReactivePanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, vararg params: Any?): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params [Map] of named parameters
* @return a new [ReactivePanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Map<String, Any?>): ReactivePanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, params: Map<String, Any?>): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params [Parameters] of named parameters
* @return a new [ReactivePanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Parameters): ReactivePanacheUpdate = throw INSTANCE.implementationInjectionMissing()
fun update(update: String, params: Parameters): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate = throw INSTANCE.implementationInjectionMissing()

/**
* Allow to access the underlying Mongo Collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,44 +683,44 @@ interface ReactivePanacheMongoRepositoryBase<Entity: Any, Id: Any> {

/**
* Update all entities of this type by the given update document, with optional indexed parameters.
* The returned [ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params optional sequence of indexed parameters
* @return a new [ReactivePanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, vararg params: Any?): ReactivePanacheUpdate =
fun update(update: String, vararg params: Any?): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params [Map] of named parameters
* @return a new [ReactivePanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Map<String, Any?>): ReactivePanacheUpdate =
fun update(update: String, params: Map<String, Any?>): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
throw INSTANCE.implementationInjectionMissing()

/**
* Update all entities of this type by the given update document, with named parameters.
* The returned [ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
* The returned [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] object will allow to restrict on which document the update should be applied.
*
* @param update the update document, if it didn't contain any update operator, we add `$set`.
* It can also be expressed as a query string.
* @param params [Parameters] of named parameters
* @return a new [ReactivePanacheUpdate] instance for the given update document
* @return a new [io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate] instance for the given update document
* @see [update]
*/
@GenerateBridge
fun update(update: String, params: Parameters): ReactivePanacheUpdate =
fun update(update: String, params: Parameters): io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate =
throw INSTANCE.implementationInjectionMissing()

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.quarkus.mongodb.panache.kotlin.reactive.runtime

import io.quarkus.mongodb.panache.common.reactive.ReactivePanacheUpdate
import io.quarkus.mongodb.panache.kotlin.reactive.ReactivePanacheQuery
import io.quarkus.mongodb.panache.reactive.ReactivePanacheUpdate
import io.quarkus.mongodb.panache.common.reactive.runtime.ReactiveMongoOperations
import io.quarkus.mongodb.panache.common.reactive.runtime.ReactivePanacheUpdateImpl
import io.quarkus.mongodb.reactive.ReactiveMongoCollection
Expand Down
Loading

0 comments on commit 9d4ccc5

Please sign in to comment.