Class SqlQueryGeneratorFactory
java.lang.Object
dimstyl.orm.internal.sql.generator.SqlQueryGeneratorFactory
Factory class for retrieving instances of SQL query generators based on the specified SQL operation.
This factory provides a centralized way to obtain the appropriate SqlQueryGenerator
instance based on the given SqlOperation
. It supports operations such as:
CREATE_TABLE
- UsesDatabaseSchemaGenerator.INSTANCE
SELECT_ALL
- UsesSelectAllQueryGenerator.INSTANCE
DELETE_BY_ID
- UsesDeleteByIdQueryGenerator.INSTANCE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Private constructor to prevent instantiation of the factory class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
T extends Metadata>
SqlQueryGenerator<K, T> getGenerator
(SqlOperation sqlOperation) Retrieves the appropriate SQL query generator based on the provided SQL operation.
-
Constructor Details
-
SqlQueryGeneratorFactory
private SqlQueryGeneratorFactory()Private constructor to prevent instantiation of the factory class.
-
-
Method Details
-
getGenerator
public static <K,T extends Metadata> SqlQueryGenerator<K,T> getGenerator(SqlOperation sqlOperation) Retrieves the appropriate SQL query generator based on the provided SQL operation.- Type Parameters:
K
- The type of the result produced by the query generator.T
- The type of metadata used in query generation, extendingMetadata
.- Parameters:
sqlOperation
- The SQL operation for which a generator is needed.- Returns:
- An instance of
SqlQueryGenerator
corresponding to the givenSqlOperation
.
-