Package com.querydsl.sql.codegen
Interface NamingStrategy
- All Known Implementing Classes:
AbstractNamingStrategy
,DefaultNamingStrategy
,ExtendedNamingStrategy
,OriginalNamingStrategy
public interface NamingStrategy
NamingStrategy
defines a conversion strategy from table to class and column
to property names- Author:
- tiwe
-
Method Summary
Modifier and TypeMethodDescriptionappendSchema
(String packageName, String schema) Deprecated.getClassName
(SchemaAndTable schemaAndTable) Convert the given schema and table name to a simple class name.getClassName
(String tableName) Deprecated.UsegetClassName(SchemaAndTable)
instead.getDefaultAlias
(EntityType entityType) Get the default alias for the given EntityTypegetDefaultVariableName
(EntityType entityType) Get the default variable name for the given EntityTypeGet the class name for the foreign keys inner classgetForeignKeysVariable
(EntityType entityType) Get the field name for the foreign keys class instancegetPackage
(String basePackage, SchemaAndTable schemaAndTable) Returns the package where the class of the table will be generated.Get the class name for the primary keys inner classgetPrimaryKeysVariable
(EntityType entityType) Get the field name for the primary keys class instancegetPropertyName
(String columnName, EntityType entityType) Convert the given column name to a property namegetPropertyNameForForeignKey
(String foreignKeyName, EntityType entityType) Convert the given foreign key name to a foreign key property namegetPropertyNameForInverseForeignKey
(String name, EntityType model) Convert the given foreign key name to a foreign key property namegetPropertyNameForPrimaryKey
(String name, EntityType model) Convert the given primary key name to a primary key property namenormalizeColumnName
(String columnName) Convert the given column name and provide the opportunity to add quoted identifiersnormalizeSchemaName
(String schemaName) Convert the given schema name and provide the opportunity to add quoted identifiersnormalizeTableName
(String tableName) Convert the given table name and provide the opportunity to add quoted identifiersboolean
shouldGenerateClass
(SchemaAndTable schemaAndTable) Returnstrue
if the class generation of the table is required, otherwisefalse
.boolean
shouldGenerateForeignKey
(SchemaAndTable schemaAndTable, ForeignKeyData foreignKeyData) Returnstrue
if the foreign key reference should be generated in the table, otherwisefalse
.
-
Method Details
-
appendSchema
Deprecated.UsegetPackage(String, SchemaAndTable)
instead.Normalizes and appends the given schema name to the package name- Parameters:
packageName
-schema
-- Returns:
-
getClassName
Deprecated.UsegetClassName(SchemaAndTable)
instead.Convert the given tableName to a simple class name- Returns:
-
getClassName
Convert the given schema and table name to a simple class name. -
getDefaultAlias
Get the default alias for the given EntityType- Parameters:
entityType
-- Returns:
-
getDefaultVariableName
Get the default variable name for the given EntityType- Parameters:
entityType
-- Returns:
-
getForeignKeysClassName
String getForeignKeysClassName()Get the class name for the foreign keys inner class- Returns:
-
getForeignKeysVariable
Get the field name for the foreign keys class instance- Returns:
-
getPrimaryKeysClassName
String getPrimaryKeysClassName()Get the class name for the primary keys inner class- Returns:
-
getPrimaryKeysVariable
Get the field name for the primary keys class instance- Returns:
-
getPropertyName
Convert the given column name to a property name- Parameters:
columnName
-entityType
-- Returns:
-
getPropertyNameForForeignKey
Convert the given foreign key name to a foreign key property name- Parameters:
foreignKeyName
-entityType
-- Returns:
-
getPropertyNameForInverseForeignKey
Convert the given foreign key name to a foreign key property name- Parameters:
name
-model
-- Returns:
-
getPropertyNameForPrimaryKey
Convert the given primary key name to a primary key property name- Parameters:
name
-model
-- Returns:
-
normalizeColumnName
Convert the given column name and provide the opportunity to add quoted identifiers- Parameters:
columnName
-- Returns:
-
normalizeTableName
Convert the given table name and provide the opportunity to add quoted identifiers- Parameters:
tableName
-- Returns:
-
normalizeSchemaName
Convert the given schema name and provide the opportunity to add quoted identifiers- Parameters:
schemaName
-- Returns:
-
shouldGenerateClass
Returnstrue
if the class generation of the table is required, otherwisefalse
.- Parameters:
schemaAndTable
- the schema and table- Returns:
-
shouldGenerateForeignKey
Returnstrue
if the foreign key reference should be generated in the table, otherwisefalse
.- Parameters:
schemaAndTable
- the schema and tableforeignKeyData
- the foreign key in the table- Returns:
-
getPackage
Returns the package where the class of the table will be generated.- Parameters:
basePackage
- the base package of the class generationschemaAndTable
- the schema and table- Returns:
-
getPackage(String, SchemaAndTable)
instead.