PanacheRepository

Functions

Link copied to clipboard
@CheckReturnValue
@GenerateBridge
open fun count(): Uni<Long>

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

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

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

@CheckReturnValue
@GenerateBridge
open fun count(query: String, vararg params: Any): Uni<Long>

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

Link copied to clipboard
@CheckReturnValue
open fun delete(entity: Entity): Uni<Void>

Delete the given entity from the database, if it is already persisted.

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

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

@CheckReturnValue
@GenerateBridge
open fun delete(query: String, vararg params: Any): Uni<Long>

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

Link copied to clipboard
@CheckReturnValue
@GenerateBridge
open fun deleteAll(): Uni<Long>

Delete all entities of this type from the database.

Link copied to clipboard
@CheckReturnValue
@GenerateBridge
open fun deleteById(id: Long): Uni<Boolean>

Delete an entity of this type by ID.

Link copied to clipboard
@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: String, sort: Sort, params: Parameters): PanacheQuery<Entity>
@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.

@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.

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
@CheckReturnValue
@GenerateBridge
open fun findById(id: Long): Uni<Entity>

Find an entity of this type by ID.

@CheckReturnValue
@GenerateBridge
open fun findById(id: Long, lockModeType: LockModeType): Uni<Entity>

Find an entity of this type by ID and lock it.

Link copied to clipboard
@CheckReturnValue
open fun flush(): Uni<Void>

Flushes all pending changes to the database.

Link copied to clipboard
open fun getSession(): Uni<Mutiny.Session>

Returns the current Mutiny.Session

Link copied to clipboard
open fun isPersistent(entity: Entity): Boolean

Returns true if the given entity is persistent in the database. If yes, all modifications to its persistent fields will be automatically committed to the database at transaction commit time.

Link copied to clipboard
@CheckReturnValue
@GenerateBridge
open fun list(query: String, params: Parameters): Uni<List<Entity>>
@CheckReturnValue
@GenerateBridge
open fun list(query: String, params: Map<String, Any>): Uni<List<Entity>>

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

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

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

@CheckReturnValue
@GenerateBridge
open fun list(query: String, sort: Sort, params: Parameters): Uni<List<Entity>>
@CheckReturnValue
@GenerateBridge
open fun list(query: String, sort: Sort, params: Map<String, Any>): Uni<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().

@CheckReturnValue
@GenerateBridge
open fun list(query: String, sort: Sort, vararg params: Any): Uni<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
@CheckReturnValue
@GenerateBridge
open fun listAll(): Uni<List<Entity>>

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

@CheckReturnValue
@GenerateBridge
open fun listAll(sort: Sort): Uni<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
@CheckReturnValue
open fun persist(entity: Entity): Uni<Entity>

@CheckReturnValue
open fun persist(entities: Stream<Entity>): Uni<Void>
@CheckReturnValue
open fun persist(entities: Iterable<Entity>): Uni<Void>
@CheckReturnValue
open fun persist(firstEntity: Entity, vararg entities: Entity): Uni<Void>

Persist all given entities.

Link copied to clipboard
@CheckReturnValue
open fun persistAndFlush(entity: Entity): Uni<Entity>

Persist the given entity in the database, if not already persisted. Then flushes all pending changes to the database.

Link copied to clipboard
@CheckReturnValue
@GenerateBridge
open fun update(query: String, params: Parameters): Uni<Int>
@CheckReturnValue
@GenerateBridge
open fun update(query: String, params: Map<String, Any>): Uni<Int>

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

@CheckReturnValue
@GenerateBridge
open fun update(query: String, vararg params: Any): Uni<Int>

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