delete

open fun delete(entity: Entity)

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

See also

Parameters

entity

the entity to delete.


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

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

WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

Return

the number of entities deleted.

See also

Parameters

query

a query string

params

optional sequence of indexed parameters


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

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

WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

Return

the number of entities deleted.

See also

Parameters

query

a query string

params

Map of named parameters


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

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

WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

Return

the number of entities deleted.

See also

Parameters

query

a query string

params

Parameters of named parameters