PanacheMongoCompanionBase

Define persistence and query methods for an Entity with a type of Id

Parameters

Entity

the entity type

Id

the ID type

Inheritors

Functions

Link copied to clipboard
@GenerateBridge
open fun count(): Long

Counts the number of this type of entity in the database.

@GenerateBridge
open fun count(query: Document): Long

Counts the number of this type of entity matching the given query

@GenerateBridge
open fun count(query: String, params: Parameters): Long

Counts the number of this type of entity matching the given query with named parameters.

@GenerateBridge
open fun count(query: String, vararg params: Any?): Long

Counts the number of this type of entity matching the given query, with optional indexed parameters.

@GenerateBridge
open fun count(query: String, params: Map<String, Any?>): Long

Counts the number of this type of entity matching the given query, with named parameters.

Link copied to clipboard
@GenerateBridge
open fun delete(query: Document): Long

Delete all entities of this type matching the given query

@GenerateBridge
open fun delete(query: String, params: Parameters): Long
@GenerateBridge
open fun delete(query: String, params: Map<String, Any?>): Long

Delete all entities of this type matching the given query, with named parameters.

@GenerateBridge
open fun delete(query: String, vararg params: Any?): Long

Delete all entities of this type matching the given query, with optional indexed parameters.

Link copied to clipboard
@GenerateBridge
open fun deleteAll(): Long

Delete all entities of this type from the database.

Link copied to clipboard
@GenerateBridge
open fun deleteById(id: Id): Boolean

Delete an entity of this type by ID.

Link copied to clipboard
@GenerateBridge
open fun find(query: Document): PanacheQuery<Entity>

Find entities using a BSON query.

@GenerateBridge
open fun find(query: String, params: Parameters): PanacheQuery<Entity>
@GenerateBridge
open fun find(query: String, params: Map<String, Any?>): PanacheQuery<Entity>

Find entities using a query, with named parameters.

@GenerateBridge
open fun find(query: String, vararg params: Any?): PanacheQuery<Entity>

Find entities using a query, with optional indexed parameters.

@GenerateBridge
open fun find(query: Document, sort: Document): PanacheQuery<Entity>

Find entities using a BSON query and a BSON sort.

@GenerateBridge
open fun find(query: String, sort: Sort, params: Parameters): PanacheQuery<Entity>

Find entities using a query and the given sort options with named parameters.

@GenerateBridge
open fun find(query: String, sort: Sort, vararg params: Any?): PanacheQuery<Entity>

Find entities using a query and the given sort options with optional indexed parameters.

@GenerateBridge
open fun find(query: String, sort: Sort, params: Map<String, Any?>): PanacheQuery<Entity>

Find entities using a query and the given sort options, with named parameters.

Link copied to clipboard
@GenerateBridge
open fun findAll(): PanacheQuery<Entity>

Find all entities of this type.

@GenerateBridge
open fun findAll(sort: Sort): PanacheQuery<Entity>

Find all entities of this type, in the given order.

Link copied to clipboard
@GenerateBridge(targetReturnTypeErased = true)
open fun findById(id: Id): Entity?

Find an entity of this type by ID.

Link copied to clipboard
@GenerateBridge
open fun list(query: Document): List<Entity>

Find entities using a BSON query. This method is a shortcut for find(query).list().

@GenerateBridge
open fun list(query: String, params: Parameters): List<Entity>
@GenerateBridge
open fun list(query: String, params: Map<String, Any?>): List<Entity>

Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).list().

@GenerateBridge
open fun list(query: String, vararg params: Any?): List<Entity>

Find entities matching a query, with optional indexed parameters. This method is a shortcut for find(query, params).list().

@GenerateBridge
open fun list(query: Document, sort: Document): List<Entity>

Find entities using a BSON query and a BSON sort. This method is a shortcut for find(query, sort).list().

@GenerateBridge
open fun list(query: String, sort: Sort, params: Parameters): List<Entity>
@GenerateBridge
open fun list(query: String, sort: Sort, params: Map<String, Any?>): List<Entity>

Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for find(query, sort, params).list().

@GenerateBridge
open fun list(query: String, sort: Sort, vararg params: Any?): List<Entity>

Find entities matching a query and the given sort options, with optional indexed parameters. This method is a shortcut for find(query, sort, params).list().

Link copied to clipboard
@GenerateBridge
open fun listAll(): List<Entity>

Find all entities of this type. This method is a shortcut for findAll().list().

@GenerateBridge
open fun listAll(sort: Sort): List<Entity>

Find all entities of this type, in the given order. This method is a shortcut for findAll(sort).list().

Link copied to clipboard
@GenerateBridge
open fun mongoCollection(): MongoCollection<Entity>

Allow to access the underlying Mongo Collection.

Link copied to clipboard
@GenerateBridge
open fun mongoDatabase(): MongoDatabase

Allow to access the underlying Mongo Database.

Link copied to clipboard
open fun persist(entities: Stream<Entity>)
open fun persist(entities: Iterable<Entity>)
open fun persist(firstEntity: Entity, vararg entities: Entity)

Insert all given entities.

Link copied to clipboard
open fun persistOrUpdate(entities: Stream<Entity>)
open fun persistOrUpdate(firstEntity: Entity, vararg entities: Entity)

Persist all given entities.

open fun persistOrUpdate(entities: Iterable<Entity>)

Persist all given entities or update them if they already exist.

Link copied to clipboard
@GenerateBridge
open fun stream(query: Document): Stream<Entity>

Find entities using a BSON query. This method is a shortcut for find(query).stream().

@GenerateBridge
open fun stream(query: String, params: Parameters): Stream<Entity>
@GenerateBridge
open fun stream(query: String, params: Map<String, Any?>): Stream<Entity>

Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).stream().

@GenerateBridge
open fun stream(query: String, vararg params: Any?): Stream<Entity>

Find entities matching a query, with optional indexed parameters. This method is a shortcut for find(query, params).stream().

@GenerateBridge
open fun stream(query: Document, sort: Document): Stream<Entity>

Find entities using a BSON query and a BSON sort. This method is a shortcut for find(query, sort).stream().

@GenerateBridge
open fun stream(query: String, sort: Sort, params: Parameters): Stream<Entity>
@GenerateBridge
open fun stream(query: String, sort: Sort, params: Map<String, Any?>): Stream<Entity>

Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for find(query, sort, params).stream().

@GenerateBridge
open fun stream(query: String, sort: Sort, vararg params: Any?): Stream<Entity>

Find entities matching a query and the given sort options, with optional indexed parameters. This method is a shortcut for find(query, sort, params).stream().

Link copied to clipboard
@GenerateBridge
open fun streamAll(): Stream<Entity>

Find all entities of this type. This method is a shortcut for findAll().stream().

@GenerateBridge
open fun streamAll(sort: Sort): Stream<Entity>

Find all entities of this type, in the given order. This method is a shortcut for findAll(sort).stream().

Link copied to clipboard
open fun update(entities: Stream<Entity>)
open fun update(entities: Iterable<Entity>)
open fun update(firstEntity: Entity, vararg entities: Entity)

Update all given entities.

@GenerateBridge
open fun update(update: Document): PanacheUpdate

Update all entities of this type by the given update BSON document. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which document the update should be applied.

@GenerateBridge
open fun update(update: String, params: Parameters): PanacheUpdate

Update all entities of this type by the given update document, with named parameters. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which document the update should be applied.

@GenerateBridge
open fun update(update: String, vararg params: Any?): PanacheUpdate

Update all entities of this type using the given update document with optional indexed parameters. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which document the update should be applied.

@GenerateBridge
open fun update(update: String, params: Map<String, Any?>): PanacheUpdate

Update all entities of this type by the given update document with named parameters. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which document the update should be applied.