Enum Class SelectAllQueryGenerator
- All Implemented Interfaces:
SqlQueryGenerator<Optional<String>,
,RepositoryMetadata> Serializable
,Comparable<SelectAllQueryGenerator>
,Constable
enum SelectAllQueryGenerator
extends Enum<SelectAllQueryGenerator>
implements SqlQueryGenerator<Optional<String>,RepositoryMetadata>
Generates an SQL `SELECT * FROM` query for retrieving all records from a table.
This generator ensures that the repository supports the `SELECT_ALL` operation before creating the query. If the operation is not supported, query generation is skipped.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate
(RepositoryMetadata repositoryMetadata) Generates an SQL `SELECT * FROM` query if the repository supports the `SELECT_ALL` operation.static SelectAllQueryGenerator
Returns the enum constant of this class with the specified name.static SelectAllQueryGenerator[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance of the SelectAllQueryGenerator.
-
-
Constructor Details
-
SelectAllQueryGenerator
private SelectAllQueryGenerator()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
generate
Generates an SQL `SELECT * FROM` query if the repository supports the `SELECT_ALL` operation.If the repository does not support this operation, query generation is skipped, and an empty
Optional
is returned.- Specified by:
generate
in interfaceSqlQueryGenerator<Optional<String>,
RepositoryMetadata> - Parameters:
repositoryMetadata
- Metadata containing information about the repository, including the table name and supported operations, as defined byRepositoryMetadata
.- Returns:
- An
Optional
containing the SQL query if the `SELECT_ALL` operation is supported, otherwise an emptyOptional
.
-