Skip to main content

Delete All

Definition

The deleteAll method allows you to delete all records of a table.

Available methods

  • deleteAll(): It does not receive any parameters.
  • deleteAll(String jdbc): Receives the name of datasource connection to which you need to connect.
  • deleteAll(KColumnAllowedToReturning... kColumnsAllowedToReturning): Receives a variable quantity of columns and values that will be added to the RETURNING clause. Among the possible values are: KTableColumn, KColumn, Columns with alias, KRaw, Case conditional expression.
  • deleteAll(String jdbc, KColumnAllowedToReturning... kColumnsAllowedToReturnings): Receives the name of datasource connection to which you need to connect and a variable quantity of columns and values that will be added to the RETURNING clause. Among the possible values are: KTableColumn, KColumn, Columns with alias, KRaw, Case conditional expression.

Example: No parameter

Java code:

languageRepository.deleteAll();

SQL generated:

DELETE
FROM language la

Parameters:

  • None

Example: String

Java code:

languageRepository.deleteAll(K.JDBC_LEGACY);

SQL generated:

DELETE
FROM language la

Parameters:

  • None

Example: KColumnAllowedToReturning...

Java code:

final KCollection<Language> languages = languageRepository.deleteAll(
LANGUAGE.NAME,
LANGUAGE.FILE
);

SQL generated:

DELETE
FROM language la
RETURNING
la.name,
la.file

Parameters:

  • None

Example: String, KColumnAllowedToReturning...

Java code:

final KCollection<Language> languages = languageRepository.deleteAll(
K.JDBC_LEGACY,
LANGUAGE.NAME,
LANGUAGE.FILE
);

SQL generated:

DELETE
FROM language la
RETURNING
la.name,
la.file

Parameters:

  • None