com.avaje.ebean.config.dbplatform
Class DbDdlSyntax

java.lang.Object
  extended by com.avaje.ebean.config.dbplatform.DbDdlSyntax

public class DbDdlSyntax
extends Object

Used to support DB specific syntax for DDL generation.


Constructor Summary
DbDdlSyntax()
           
 
Method Summary
 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 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 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 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbDdlSyntax

public DbDdlSyntax()
Method Detail

getPrimaryKeyName

public String getPrimaryKeyName(String tableName)
Return the primary key name for a given bean descriptor.


getIdentity

public String getIdentity()
Return the identity clause for DB's that have identities.


setIdentity

public void setIdentity(String identity)
Set the identity clause.


getColumnNameWidth

public int getColumnNameWidth()
Return the width for padding whitespace after column names.


setColumnNameWidth

public void setColumnNameWidth(int columnNameWidth)
Set the amount of padding to write after the column name.


getNewLine

public String getNewLine()
Return the new line character.


setNewLine

public void setNewLine(String newLine)
Set the new line character.


getPkPrefix

public String getPkPrefix()
Return the prefix used in naming primary keys.


setPkPrefix

public void setPkPrefix(String pkPrefix)
Set the prefix used in naming primary keys.


getDisableReferentialIntegrity

public String getDisableReferentialIntegrity()
Return the DB specific command to disable referential integrity


setDisableReferentialIntegrity

public void setDisableReferentialIntegrity(String disableReferentialIntegrity)
Set the DB specific command to disable referential integrity


getEnableReferentialIntegrity

public String getEnableReferentialIntegrity()
Return the DB specific command to enable referential integrity


setEnableReferentialIntegrity

public void setEnableReferentialIntegrity(String enableReferentialIntegrity)
Set the DB specific command to enable referential integrity


isRenderIndexForFkey

public boolean isRenderIndexForFkey()
Return true if indexes should be created for the foreign keys.


setRenderIndexForFkey

public void setRenderIndexForFkey(boolean renderIndexForFkey)
Set whether indexes should be created for the foreign keys.


getDropIfExists

public String getDropIfExists()
Typically returns IF EXISTS (if that is supported by the database platform) or null.


setDropIfExists

public void setDropIfExists(String dropIfExists)
Set the IF EXISTS clause for dropping tables if that is supported by the database platform.


getDropTableCascade

public String getDropTableCascade()
Return the cascade option for the drop table command.


setDropTableCascade

public void setDropTableCascade(String dropTableCascade)
Set the cascade option for the drop table command.


getForeignKeySuffix

public String getForeignKeySuffix()
Return the foreign key suffix.


setForeignKeySuffix

public void setForeignKeySuffix(String foreignKeySuffix)
Set the foreign key suffix.


getMaxConstraintNameLength

public int getMaxConstraintNameLength()
Return the maximum length that constraint names can be for this database.


setMaxConstraintNameLength

public void setMaxConstraintNameLength(int maxFkeyLength)
Set the maximum length that constraint names can be for this database.


isAddOneToOneUniqueContraint

public boolean isAddOneToOneUniqueContraint()
Return true if imported side of OneToOne's should have unique constraints generated.


setAddOneToOneUniqueContraint

public void setAddOneToOneUniqueContraint(boolean addOneToOneUniqueContraint)
Set to false for DB's that don't want both a unique and index on the imported OneToOne.


getIndexName

public String getIndexName(String table,
                           String propName,
                           int ixCount)

getForeignKeyName

public String getForeignKeyName(String table,
                                String propName,
                                int fkCount)


Copyright © 2010. All Rights Reserved.