PanacheCompanion

Defines methods to be used via the companion objects of entities.

Parameters

Entity

the entity type

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
@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: Any): 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
@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
open fun getSession(): Uni<Mutiny.Session>

Returns the current Mutiny.Session

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(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
@GenerateBridge
open fun stream(query: String, params: Parameters): Multi<Entity>
@CheckReturnValue
@GenerateBridge
open fun stream(query: String, params: Map<String, Any>): Multi<Entity>

Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

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

Find entities matching a query, with optional indexed parameters. This method is a shortcut for find(query, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

@CheckReturnValue
@GenerateBridge
open fun stream(query: String, sort: Sort, params: Parameters): Multi<Entity>
@CheckReturnValue
@GenerateBridge
open fun stream(query: String, sort: Sort, params: Map<String, Any>): Multi<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(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

@CheckReturnValue
@GenerateBridge
open fun stream(query: String, sort: Sort, vararg params: Any): Multi<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(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

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

Find all entities of this type. This method is a shortcut for findAll().stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

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

Find all entities of this type, in the given order. This method is a shortcut for findAll(sort).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

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.