public abstract class AbstractNamingStrategy extends Object implements NamingStrategy
AbstractNamingStrategy
is an abstract base class for NamingStrategy
implementationsModifier and Type | Field and Description |
---|---|
protected String |
foreignKeysClassName |
protected String |
foreignKeysVariable |
protected String |
primaryKeysClassName |
protected String |
primaryKeysVariable |
protected String |
reservedSuffix |
Constructor and Description |
---|
AbstractNamingStrategy() |
Modifier and Type | Method and Description |
---|---|
String |
appendSchema(String packageName,
String schemaName)
Normalizes and appends the given schema name to the package name
|
protected String |
escape(EntityType entityType,
String name) |
String |
getClassName(SchemaAndTable schemaAndTable)
Convert the given schema and table name to a simple class name.
|
String |
getForeignKeysClassName()
Get the class name for the foreign keys inner class
|
String |
getForeignKeysVariable(EntityType entityType)
Get the field name for the foreign keys class instance
|
String |
getPackage(String basePackage,
SchemaAndTable schemaAndTable)
Returns the package where the class of the table will be generated.
|
String |
getPrimaryKeysClassName()
Get the class name for the primary keys inner class
|
String |
getPrimaryKeysVariable(EntityType entityType)
Get the field name for the primary keys class instance
|
String |
normalizeColumnName(String columnName)
Convert the given column name and provide the opportunity to add quoted identifiers
|
protected String |
normalizeJavaName(String name) |
String |
normalizeSchemaName(String schemaName)
Convert the given schema name and provide the opportunity to add quoted identifiers
|
protected String |
normalizeSQLName(String name) |
String |
normalizeTableName(String tableName)
Convert the given table name and provide the opportunity to add quoted identifiers
|
void |
setForeignKeysClassName(String foreignKeysClassName) |
void |
setForeignKeysVariable(String foreignKeysVariable) |
void |
setPrimaryKeysClassName(String primaryKeysClassName) |
void |
setPrimaryKeysVariable(String primaryKeysVariable) |
void |
setReservedSuffix(String reservedSuffix) |
boolean |
shouldGenerateClass(SchemaAndTable schemaAndTable)
Returns
true if the class generation of the table is required, otherwise
false . |
boolean |
shouldGenerateForeignKey(SchemaAndTable schemaAndTable,
ForeignKeyData foreignKeyData)
Returns
true if the foreign key reference should be generated in the table,
otherwise false . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getClassName, getDefaultAlias, getDefaultVariableName, getPropertyName, getPropertyNameForForeignKey, getPropertyNameForInverseForeignKey, getPropertyNameForPrimaryKey
protected String foreignKeysClassName
protected String foreignKeysVariable
protected String primaryKeysClassName
protected String primaryKeysVariable
protected String reservedSuffix
public String appendSchema(String packageName, String schemaName)
NamingStrategy
appendSchema
in interface NamingStrategy
protected String escape(EntityType entityType, String name)
public String getForeignKeysClassName()
NamingStrategy
getForeignKeysClassName
in interface NamingStrategy
public String getForeignKeysVariable(EntityType entityType)
NamingStrategy
getForeignKeysVariable
in interface NamingStrategy
public String getPrimaryKeysClassName()
NamingStrategy
getPrimaryKeysClassName
in interface NamingStrategy
public String getPrimaryKeysVariable(EntityType entityType)
NamingStrategy
getPrimaryKeysVariable
in interface NamingStrategy
public String normalizeColumnName(String columnName)
NamingStrategy
normalizeColumnName
in interface NamingStrategy
public String normalizeTableName(String tableName)
NamingStrategy
normalizeTableName
in interface NamingStrategy
public String normalizeSchemaName(String schemaName)
NamingStrategy
normalizeSchemaName
in interface NamingStrategy
public void setForeignKeysClassName(String foreignKeysClassName)
public void setForeignKeysVariable(String foreignKeysVariable)
public void setPrimaryKeysClassName(String primaryKeysClassName)
public void setPrimaryKeysVariable(String primaryKeysVariable)
public void setReservedSuffix(String reservedSuffix)
public String getPackage(String basePackage, SchemaAndTable schemaAndTable)
NamingStrategy
getPackage
in interface NamingStrategy
basePackage
- the base package of the class generationschemaAndTable
- the schema and tablepublic boolean shouldGenerateClass(SchemaAndTable schemaAndTable)
NamingStrategy
true
if the class generation of the table is required, otherwise
false
.shouldGenerateClass
in interface NamingStrategy
schemaAndTable
- the schema and tablepublic boolean shouldGenerateForeignKey(SchemaAndTable schemaAndTable, ForeignKeyData foreignKeyData)
NamingStrategy
true
if the foreign key reference should be generated in the table,
otherwise false
.shouldGenerateForeignKey
in interface NamingStrategy
schemaAndTable
- the schema and tableforeignKeyData
- the foreign key in the tablepublic String getClassName(SchemaAndTable schemaAndTable)
NamingStrategy
getClassName
in interface NamingStrategy
Copyright © 2007–2016 Querydsl. All rights reserved.