-
- All Implemented Interfaces:
public interface PanacheMongoCompanionBase<Entity extends PanacheMongoEntityBase, Id extends Object>Define persistence and query methods for an Entity with a type of Id
-
-
Method Summary
Modifier and Type Method Description EntityfindById(Id id)Find an entity of this type by ID. PanacheQuery<Entity>find(String query, Object params)Find entities using a query, with optional indexed parameters. PanacheQuery<Entity>find(String query, Sort sort, Object params)Find entities using a query and the given sort options with optional indexed parameters. PanacheQuery<Entity>find(String query, Map<String, Object> params)Find entities using a query, with named parameters. PanacheQuery<Entity>find(String query, Sort sort, Map<String, Object> params)Find entities using a query and the given sort options, with named parameters. PanacheQuery<Entity>find(String query, Parameters params)Find entities using a query, with named parameters. PanacheQuery<Entity>find(String query, Sort sort, Parameters params)Find entities using a query and the given sort options with named parameters. PanacheQuery<Entity>find(Document query)Find entities using a BSON query. PanacheQuery<Entity>find(Document query, Document sort)Find entities using a a BSON query and a BSON sort. PanacheQuery<Entity>findAll()Find all entities of this type. PanacheQuery<Entity>findAll(Sort sort)Find all entities of this type, in the given order. List<Entity>list(String query, Object params)Find entities matching a query, with optional indexed parameters. List<Entity>list(String query, Sort sort, Object params)Find entities matching a query and the given sort options, with optional indexed parameters. List<Entity>list(String query, Map<String, Object> params)Find entities matching a query, with named parameters. List<Entity>list(String query, Sort sort, Map<String, Object> params)Find entities matching a query and the given sort options, with named parameters. List<Entity>list(String query, Parameters params)Find entities matching a query, with named parameters. List<Entity>list(String query, Sort sort, Parameters params)Find entities matching a query and the given sort options, with named parameters. List<Entity>list(Document query)Find entities using a BSON query. List<Entity>list(Document query, Document sort)Find entities using a a BSON query and a BSON sort. List<Entity>listAll()Find all entities of this type. List<Entity>listAll(Sort sort)Find all entities of this type, in the given order. Stream<Entity>stream(String query, Object params)Find entities matching a query, with optional indexed parameters. Stream<Entity>stream(String query, Sort sort, Object params)Find entities matching a query and the given sort options, with optional indexed parameters. Stream<Entity>stream(String query, Map<String, Object> params)Find entities matching a query, with named parameters. Stream<Entity>stream(String query, Sort sort, Map<String, Object> params)Find entities matching a query and the given sort options, with named parameters. Stream<Entity>stream(String query, Parameters params)Find entities matching a query, with named parameters. Stream<Entity>stream(String query, Sort sort, Parameters params)Find entities matching a query and the given sort options, with named parameters. Stream<Entity>stream(Document query)Find entities using a BSON query. Stream<Entity>stream(Document query, Document sort)Find entities using a a BSON query and a BSON sort. Stream<Entity>streamAll()Find all entities of this type. Stream<Entity>streamAll(Sort sort)Find all entities of this type, in the given order. Longcount()Counts the number of this type of entity in the database. Longcount(String query, Object params)Counts the number of this type of entity matching the given query, with optional indexed parameters. Longcount(String query, Map<String, Object> params)Counts the number of this type of entity matching the given query, with named parameters. Longcount(String query, Parameters params)Counts the number of this type of entity matching the given query with named parameters. Longcount(Document query)Counts the number of this type of entity matching the given query LongdeleteAll()Delete all entities of this type from the database. Longdelete(String query, Object params)Delete all entities of this type matching the given query, with optional indexed parameters. Longdelete(String query, Map<String, Object> params)Delete all entities of this type matching the given query, with named parameters. Longdelete(String query, Parameters params)Delete all entities of this type matching the given query, with named parameters. Longdelete(Document query)Delete all entities of this type matching the given query BooleandeleteById(Id id)Delete an entity of this type by ID. Unitpersist(Iterable<Entity> entities)Insert all given entities. Unitpersist(Stream<Entity> entities)Insert all given entities. Unitpersist(Entity firstEntity, Entity entities)Insert all given entities. Unitupdate(Iterable<Entity> entities)Update all given entities. Unitupdate(Stream<Entity> entities)Update all given entities. Unitupdate(Entity firstEntity, Entity entities)Update all given entities. PanacheUpdateupdate(String update, Object params)Update all entities of this type using the given update document with optional indexed parameters. PanacheUpdateupdate(String update, Map<String, Object> params)Update all entities of this type by the given update document with named parameters. PanacheUpdateupdate(String update, Parameters params)Update all entities of this type by the given update document, with named parameters. UnitpersistOrUpdate(Iterable<Entity> entities)Persist all given entities or update them if they already exist. UnitpersistOrUpdate(Stream<Entity> entities)Persist all given entities. UnitpersistOrUpdate(Entity firstEntity, Entity entities)Persist all given entities. MongoCollection<Entity>mongoCollection()Allow to access the underlying Mongo Collection. MongoDatabasemongoDatabase()Allow to access the underlying Mongo Database. -
-
Method Detail
-
findById
@GenerateBridge(targetReturnTypeErased = true) Entity findById(Id id)
Find an entity of this type by ID.
- Parameters:
id- the ID of the entity to find.
-
find
@GenerateBridge() PanacheQuery<Entity> find(String query, Object params)
Find entities using a query, with optional indexed parameters.
- Parameters:
query- a query stringparams- optional sequence of indexed parameters
-
find
@GenerateBridge() PanacheQuery<Entity> find(String query, Sort sort, Object params)
Find entities using a query and the given sort options with optional indexed parameters.
- Parameters:
query- a query stringsort- the sort strategy to useparams- optional sequence of indexed parameters
-
find
@GenerateBridge() PanacheQuery<Entity> find(String query, Map<String, Object> params)
Find entities using a query, with named parameters.
- Parameters:
query- a query stringparams- Map of named parameters
-
find
@GenerateBridge() PanacheQuery<Entity> find(String query, Sort sort, Map<String, Object> params)
Find entities using a query and the given sort options, with named parameters.
- Parameters:
query- a query stringsort- the sort strategy to useparams- Map of indexed parameters
-
find
@GenerateBridge() PanacheQuery<Entity> find(String query, Parameters params)
Find entities using a query, with named parameters.
- Parameters:
query- a query stringparams- Parameters of named parameters
-
find
@GenerateBridge() PanacheQuery<Entity> find(String query, Sort sort, Parameters params)
Find entities using a query and the given sort options with named parameters.
- Parameters:
query- a query stringsort- the sort strategy to useparams- Parameters of indexed parameters
-
find
@GenerateBridge() PanacheQuery<Entity> find(Document query)
Find entities using a BSON query.
- Parameters:
query- a query string
-
find
@GenerateBridge() PanacheQuery<Entity> find(Document query, Document sort)
Find entities using a a BSON query and a BSON sort.
- Parameters:
query- a query stringsort- the sort strategy to use
-
findAll
@GenerateBridge() PanacheQuery<Entity> findAll()
Find all entities of this type.
-
findAll
@GenerateBridge() PanacheQuery<Entity> findAll(Sort sort)
Find all entities of this type, in the given order.
- Parameters:
sort- the sort order to use
-
list
@GenerateBridge() List<Entity> list(String query, Object params)
Find entities matching a query, with optional indexed parameters. This method is a shortcut for
find(query, params).list().- Parameters:
query- a query stringparams- optional sequence of indexed parameters
-
list
@GenerateBridge() List<Entity> list(String query, Sort sort, Object params)
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().- Parameters:
query- a query stringsort- the sort strategy to useparams- optional sequence of indexed parameters
-
list
@GenerateBridge() List<Entity> list(String query, Map<String, Object> params)
Find entities matching a query, with named parameters. This method is a shortcut for
find(query, params).list().- Parameters:
query- a query stringparams- Map of named parameters
-
list
@GenerateBridge() List<Entity> list(String query, Sort sort, Map<String, Object> params)
Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for
find(query, sort, params).list().- Parameters:
query- a query stringsort- the sort strategy to useparams- Map of indexed parameters
-
list
@GenerateBridge() List<Entity> list(String query, Parameters params)
Find entities matching a query, with named parameters. This method is a shortcut for
find(query, params).list().- Parameters:
query- a query stringparams- Parameters of named parameters
-
list
@GenerateBridge() List<Entity> list(String query, Sort sort, Parameters params)
Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for
find(query, sort, params).list().- Parameters:
query- a query stringsort- the sort strategy to useparams- Parameters of indexed parameters
-
list
@GenerateBridge() List<Entity> list(Document query)
Find entities using a BSON query. This method is a shortcut for
find(query).list().- Parameters:
query- a query document
-
list
@GenerateBridge() List<Entity> list(Document query, Document sort)
Find entities using a a BSON query and a BSON sort. This method is a shortcut for
find(query, sort).list().- Parameters:
query- a query documentsort- the sort document
-
listAll
@GenerateBridge() List<Entity> listAll()
Find all entities of this type. This method is a shortcut for
findAll().list().
-
listAll
@GenerateBridge() List<Entity> listAll(Sort sort)
Find all entities of this type, in the given order. This method is a shortcut for
findAll(sort).list().- Parameters:
sort- the sort order to use
-
stream
@GenerateBridge() Stream<Entity> stream(String query, Object params)
Find entities matching a query, with optional indexed parameters. This method is a shortcut for
find(query, params).stream().- Parameters:
query- a query stringparams- optional sequence of indexed parameters
-
stream
@GenerateBridge() Stream<Entity> stream(String query, Sort sort, Object params)
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().- Parameters:
query- a query stringsort- the sort strategy to useparams- optional sequence of indexed parameters
-
stream
@GenerateBridge() Stream<Entity> stream(String query, Map<String, Object> params)
Find entities matching a query, with named parameters. This method is a shortcut for
find(query, params).stream().- Parameters:
query- a query stringparams- Map of named parameters
-
stream
@GenerateBridge() Stream<Entity> stream(String query, Sort sort, Map<String, Object> params)
Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for
find(query, sort, params).stream().- Parameters:
query- a query stringsort- the sort strategy to useparams- Map of indexed parameters
-
stream
@GenerateBridge() Stream<Entity> stream(String query, Parameters params)
Find entities matching a query, with named parameters. This method is a shortcut for
find(query, params).stream().- Parameters:
query- a query stringparams- Parameters of named parameters
-
stream
@GenerateBridge() Stream<Entity> stream(String query, Sort sort, Parameters params)
Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for
find(query, sort, params).stream().- Parameters:
query- a query stringsort- the sort strategy to useparams- Parameters of indexed parameters
-
stream
@GenerateBridge() Stream<Entity> stream(Document query)
Find entities using a BSON query. This method is a shortcut for
find(query).stream().- Parameters:
query- a query Document
-
stream
@GenerateBridge() Stream<Entity> stream(Document query, Document sort)
Find entities using a a BSON query and a BSON sort. This method is a shortcut for
find(query, sort).stream().- Parameters:
query- a query Documentsort- the sort strategy to use
-
streamAll
@GenerateBridge() Stream<Entity> streamAll()
Find all entities of this type. This method is a shortcut for
findAll().stream().
-
streamAll
@GenerateBridge() Stream<Entity> streamAll(Sort sort)
Find all entities of this type, in the given order. This method is a shortcut for
findAll(sort).stream().- Parameters:
sort- the sort order to use
-
count
@GenerateBridge() Long count(String query, Object params)
Counts the number of this type of entity matching the given query, with optional indexed parameters.
- Parameters:
query- a query stringparams- optional sequence of indexed parameters
-
count
@GenerateBridge() Long count(String query, Map<String, Object> params)
Counts the number of this type of entity matching the given query, with named parameters.
- Parameters:
query- a query stringparams- Map of named parameters
-
count
@GenerateBridge() Long count(String query, Parameters params)
Counts the number of this type of entity matching the given query with named parameters.
- Parameters:
query- a query stringparams- Parameters of named parameters
-
count
@GenerateBridge() Long count(Document query)
Counts the number of this type of entity matching the given query
- Parameters:
query- a query document
-
delete
@GenerateBridge() Long delete(String query, Object params)
Delete all entities of this type matching the given query, with optional indexed parameters.
- Parameters:
query- a query stringparams- optional sequence of indexed parameters
-
delete
@GenerateBridge() Long delete(String query, Map<String, Object> params)
Delete all entities of this type matching the given query, with named parameters.
- Parameters:
query- a query stringparams- Map of named parameters
-
delete
@GenerateBridge() Long delete(String query, Parameters params)
Delete all entities of this type matching the given query, with named parameters.
- Parameters:
query- a query stringparams- Parameters of named parameters
-
delete
@GenerateBridge() Long delete(Document query)
Delete all entities of this type matching the given query
- Parameters:
query- a query document
-
deleteById
@GenerateBridge() Boolean deleteById(Id id)
Delete an entity of this type by ID.
- Parameters:
id- the ID of the entity to delete.
-
persist
Unit persist(Iterable<Entity> entities)
Insert all given entities.
- Parameters:
entities- the entities to insert
-
persist
Unit persist(Stream<Entity> entities)
Insert all given entities.
- Parameters:
entities- the entities to insert
-
persist
Unit persist(Entity firstEntity, Entity entities)
Insert all given entities.
- Parameters:
entities- the entities to insert
-
update
Unit update(Iterable<Entity> entities)
Update all given entities.
- Parameters:
entities- the entities to update
-
update
Unit update(Stream<Entity> entities)
Update all given entities.
- Parameters:
entities- the entities to insert
-
update
Unit update(Entity firstEntity, Entity entities)
Update all given entities.
- Parameters:
entities- the entities to update
-
update
@GenerateBridge() PanacheUpdate update(String update, Object params)
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.
- Parameters:
update- the update document, if it didn't contain any update operator, we add$set.params- optional sequence of indexed parameters
-
update
@GenerateBridge() PanacheUpdate update(String update, Map<String, Object> params)
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.
- Parameters:
update- the update document, if it didn't contain any update operator, we add$set.params- map of named parameters
-
update
@GenerateBridge() PanacheUpdate update(String update, Parameters params)
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.
- Parameters:
update- the update document, if it didn't contain any update operator, we add$set.params- Parameters of named parameters
-
persistOrUpdate
Unit persistOrUpdate(Iterable<Entity> entities)
Persist all given entities or update them if they already exist.
- Parameters:
entities- the entities to update
-
persistOrUpdate
Unit persistOrUpdate(Stream<Entity> entities)
Persist all given entities.
- Parameters:
entities- the entities to insert
-
persistOrUpdate
Unit persistOrUpdate(Entity firstEntity, Entity entities)
Persist all given entities.
- Parameters:
entities- the entities to update
-
mongoCollection
@GenerateBridge() MongoCollection<Entity> mongoCollection()
Allow to access the underlying Mongo Collection.
-
mongoDatabase
@GenerateBridge() MongoDatabase mongoDatabase()
Allow to access the underlying Mongo Database.
-
-
-
-