public class DbDdlSyntax extends Object
| Constructor and Description |
|---|
DbDdlSyntax() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSuffix(StringBuilder buffer,
int count)
Adds the suffix.
|
int |
getColumnNameWidth()
Return the width for padding whitespace after column names.
|
String |
getDisableReferentialIntegrity()
Return the DB specific command to disable referential integrity
|
String |
getDropIfExists()
Typically returns IF EXISTS (if that is supported by the database platform)
or null.
|
String |
getDropTableCascade()
Return the cascade option for the drop table command.
|
String |
getEnableReferentialIntegrity()
Return the DB specific command to enable referential integrity
|
String |
getForeignKeyName(String table,
String propName,
int fkCount) |
String |
getForeignKeySuffix()
Return the foreign key suffix.
|
String |
getIdentity()
Return the identity clause for DB's that have identities.
|
String |
getIdentitySuffix()
Typically returns empty string but for SQLite and perhaps others
the Identity/AutoIncrement clause comes after the primary key clause.
|
String |
getIndexName(String table,
String propName,
int ixCount) |
int |
getMaxConstraintNameLength()
Return the maximum length that constraint names can be for this database.
|
String |
getNewLine()
Return the new line character.
|
String |
getPkPrefix()
Return the prefix used in naming primary keys.
|
String |
getPrimaryKeyName(String tableName)
Return the primary key name for a given bean descriptor.
|
boolean |
isAddOneToOneUniqueContraint()
Return true if imported side of OneToOne's should have unique constraints
generated.
|
boolean |
isInlinePrimaryKeyConstraint()
Return true if primary key constraints should be inlined when they are a
single column.
|
boolean |
isRenderIndexForFkey()
Return true if indexes should be created for the foreign keys.
|
void |
setAddOneToOneUniqueContraint(boolean addOneToOneUniqueContraint)
Set to false for DB's that don't want both a unique and index on the
imported OneToOne.
|
void |
setColumnNameWidth(int columnNameWidth)
Set the amount of padding to write after the column name.
|
void |
setDisableReferentialIntegrity(String disableReferentialIntegrity)
Set the DB specific command to disable referential integrity
|
void |
setDropIfExists(String dropIfExists)
Set the IF EXISTS clause for dropping tables if that is supported by the
database platform.
|
void |
setDropTableCascade(String dropTableCascade)
Set the cascade option for the drop table command.
|
void |
setEnableReferentialIntegrity(String enableReferentialIntegrity)
Set the DB specific command to enable referential integrity
|
void |
setForeignKeySuffix(String foreignKeySuffix)
Set the foreign key suffix.
|
void |
setIdentity(String identity)
Set the identity clause.
|
void |
setIdentitySuffix(String identitySuffix)
Set the identity clause that would appear after the primary key clause.
|
void |
setInlinePrimaryKeyConstraint(boolean inlinePrimaryKeyConstraint)
Set whether to inline primary key constraints.
|
void |
setMaxConstraintNameLength(int maxFkeyLength)
Set the maximum length that constraint names can be for this database.
|
void |
setNewLine(String newLine)
Set the new line character.
|
void |
setPkPrefix(String pkPrefix)
Set the prefix used in naming primary keys.
|
void |
setRenderIndexForFkey(boolean renderIndexForFkey)
Set whether indexes should be created for the foreign keys.
|
public String getPrimaryKeyName(String tableName)
public String getIdentity()
public void setIdentity(String identity)
public String getIdentitySuffix()
public void setIdentitySuffix(String identitySuffix)
Only used for SQLite at this stage.
public int getColumnNameWidth()
public void setColumnNameWidth(int columnNameWidth)
public String getNewLine()
public void setNewLine(String newLine)
public String getPkPrefix()
public void setPkPrefix(String pkPrefix)
public String getDisableReferentialIntegrity()
public void setDisableReferentialIntegrity(String disableReferentialIntegrity)
public String getEnableReferentialIntegrity()
public void setEnableReferentialIntegrity(String enableReferentialIntegrity)
public boolean isRenderIndexForFkey()
public void setRenderIndexForFkey(boolean renderIndexForFkey)
public String getDropIfExists()
public void setDropIfExists(String dropIfExists)
public String getDropTableCascade()
public void setDropTableCascade(String dropTableCascade)
public String getForeignKeySuffix()
public void setForeignKeySuffix(String foreignKeySuffix)
public int getMaxConstraintNameLength()
public void setMaxConstraintNameLength(int maxFkeyLength)
public boolean isAddOneToOneUniqueContraint()
public void setAddOneToOneUniqueContraint(boolean addOneToOneUniqueContraint)
public boolean isInlinePrimaryKeyConstraint()
public void setInlinePrimaryKeyConstraint(boolean inlinePrimaryKeyConstraint)
protected void addSuffix(StringBuilder buffer, int count)
buffer - the buffercount - the countCopyright © 2014. All Rights Reserved.