Package com.querydsl.sql.codegen
Class AbstractNamingStrategy
java.lang.Object
com.querydsl.sql.codegen.AbstractNamingStrategy
- All Implemented Interfaces:
NamingStrategy
- Direct Known Subclasses:
DefaultNamingStrategy
,OriginalNamingStrategy
AbstractNamingStrategy
is an abstract base class for NamingStrategy
implementations- Author:
- tiwe
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendSchema
(String packageName, String schemaName) Normalizes and appends the given schema name to the package nameprotected String
escape
(EntityType entityType, String name) getClassName
(SchemaAndTable schemaAndTable) Convert the given schema and table name to a simple class name.Get 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 instancenormalizeColumnName
(String columnName) Convert the given column name and provide the opportunity to add quoted identifiersprotected String
normalizeJavaName
(String name) normalizeSchemaName
(String schemaName) Convert the given schema name and provide the opportunity to add quoted identifiersprotected String
normalizeSQLName
(String name) normalizeTableName
(String tableName) Convert the given table name and provide the opportunity to add quoted identifiersvoid
setForeignKeysClassName
(String foreignKeysClassName) void
setForeignKeysVariable
(String foreignKeysVariable) void
setPrimaryKeysClassName
(String primaryKeysClassName) void
setPrimaryKeysVariable
(String primaryKeysVariable) void
setReservedSuffix
(String reservedSuffix) boolean
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
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.querydsl.sql.codegen.NamingStrategy
getClassName, getDefaultAlias, getDefaultVariableName, getPropertyName, getPropertyNameForForeignKey, getPropertyNameForInverseForeignKey, getPropertyNameForPrimaryKey
-
Field Details
-
foreignKeysClassName
-
foreignKeysVariable
-
-
primaryKeysVariable
-
reservedSuffix
-
-
Constructor Details
-
AbstractNamingStrategy
public AbstractNamingStrategy()
-
-
Method Details
-
appendSchema
Description copied from interface:NamingStrategy
Normalizes and appends the given schema name to the package name- Specified by:
appendSchema
in interfaceNamingStrategy
- Returns:
-
escape
-
getForeignKeysClassName
Description copied from interface:NamingStrategy
Get the class name for the foreign keys inner class- Specified by:
getForeignKeysClassName
in interfaceNamingStrategy
- Returns:
-
getForeignKeysVariable
Description copied from interface:NamingStrategy
Get the field name for the foreign keys class instance- Specified by:
getForeignKeysVariable
in interfaceNamingStrategy
- Returns:
-
getPrimaryKeysClassName
Description copied from interface:NamingStrategy
Get the class name for the primary keys inner class- Specified by:
getPrimaryKeysClassName
in interfaceNamingStrategy
- Returns:
-
getPrimaryKeysVariable
Description copied from interface:NamingStrategy
Get the field name for the primary keys class instance- Specified by:
getPrimaryKeysVariable
in interfaceNamingStrategy
- Returns:
-
normalizeColumnName
Description copied from interface:NamingStrategy
Convert the given column name and provide the opportunity to add quoted identifiers- Specified by:
normalizeColumnName
in interfaceNamingStrategy
- Returns:
-
normalizeTableName
Description copied from interface:NamingStrategy
Convert the given table name and provide the opportunity to add quoted identifiers- Specified by:
normalizeTableName
in interfaceNamingStrategy
- Returns:
-
normalizeSchemaName
Description copied from interface:NamingStrategy
Convert the given schema name and provide the opportunity to add quoted identifiers- Specified by:
normalizeSchemaName
in interfaceNamingStrategy
- Returns:
-
normalizeSQLName
-
normalizeJavaName
-
setForeignKeysClassName
-
setForeignKeysVariable
-
setPrimaryKeysClassName
-
setPrimaryKeysVariable
-
setReservedSuffix
-
getPackage
Description copied from interface:NamingStrategy
Returns the package where the class of the table will be generated.- Specified by:
getPackage
in interfaceNamingStrategy
- Parameters:
basePackage
- the base package of the class generationschemaAndTable
- the schema and table- Returns:
-
shouldGenerateClass
Description copied from interface:NamingStrategy
Returnstrue
if the class generation of the table is required, otherwisefalse
.- Specified by:
shouldGenerateClass
in interfaceNamingStrategy
- Parameters:
schemaAndTable
- the schema and table- Returns:
-
shouldGenerateForeignKey
public boolean shouldGenerateForeignKey(SchemaAndTable schemaAndTable, ForeignKeyData foreignKeyData) Description copied from interface:NamingStrategy
Returnstrue
if the foreign key reference should be generated in the table, otherwisefalse
.- Specified by:
shouldGenerateForeignKey
in interfaceNamingStrategy
- Parameters:
schemaAndTable
- the schema and tableforeignKeyData
- the foreign key in the table- Returns:
-
getClassName
Description copied from interface:NamingStrategy
Convert the given schema and table name to a simple class name.- Specified by:
getClassName
in interfaceNamingStrategy
-