Java Doc for DialectUtils.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » fw » dialects » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.fw.dialects 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.squirrel_sql.fw.dialects.DialectUtils

DialectUtils
public class DialectUtils (Code)
A simple utility class in which to place common code shared amongst the dialects. Since the dialects all inherit behavior from specific server dialects, it is not possible to inherit common behavior from a single base class. So, this class is where common code is located.
author:
   manningr


Field Summary
final public static  StringADD_DEFAULT_CLAUSE
    
final public static  intADD_PRIMARY_KEY_TYPE
    
final public static  StringALTER_COLUMN_CLAUSE
    
final public static  StringCASCADE_CLAUSE
    
final public static  StringCASCADE_CONSTRAINTS_CLAUSE
    
final public static  StringCOLUMN_CLAUSE
    
final public static  intCOLUMN_COMMENT_ALTER_TYPE
    
final public static  intCOLUMN_DEFAULT_ALTER_TYPE
    
final public static  intCOLUMN_DROP_TYPE
    
final public static  intCOLUMN_NAME_ALTER_TYPE
    
final public static  intCOLUMN_NULL_ALTER_TYPE
    
final public static  intCOLUMN_TYPE_ALTER_TYPE
    
final public static  StringDEFAULT_CLAUSE
    
final public static  StringDROP_CLAUSE
    
final public static  StringDROP_COLUMN_CLAUSE
    
final public static  StringDROP_DEFAULT_CLAUSE
    
final public static  intDROP_PRIMARY_KEY_TYPE
    
final public static  StringMODIFY_CLAUSE
    
final public static  StringMODIFY_COLUMN_CLAUSE
    
final public static  StringRENAME_COLUMN_CLAUSE
    
final public static  StringRENAME_TO_CLAUSE
    
final public static  StringSET_CLAUSE
    
final public static  StringSET_DATA_TYPE_CLAUSE
    
final public static  StringSET_DEFAULT_CLAUSE
    
final public static  StringTO_CLAUSE
    
final public static  StringTYPE_CLAUSE
    


Method Summary
public static  StringappendDefaultClause(TableColumnInfo info, StringBuilder buffer)
    
public static  List<String>createIndexes(ITableInfo ti, ISQLDatabaseMetaData md, List<PrimaryKeyInfo> primaryKeys)
    
public static  StringgetAddIndexSQL(String indexName, boolean unique, TableColumnInfo[] columns)
    
public static  StringgetAddPrimaryKeySQL(ITableInfo ti, String pkName, TableColumnInfo[] colInfos, boolean appendConstraintName)
     Returns the SQL for creating a primary key consisting of the specified colInfos.
public static  StringgetColumnAddSQL(TableColumnInfo info, HibernateDialect dialect, boolean addDefaultClause, boolean supportsNullQualifier, boolean addNullClause)
     Returns the SQL statement to use to add a column to the specified table using the information about the new column specified by info.
Parameters:
  info - information about the new column such as type, name, etc.
Parameters:
  dialect - the HibernateDialect to use to resolve the type
Parameters:
  addDefaultClause - whether or not the dialect's SQL supports a DEFAULT clause for columns.
public static  StringgetColumnCommentAlterSQL(String tableName, String columnName, String comment)
     Returns the SQL statement to use to add a comment to the specified column of the specified table.
public static  StringgetColumnCommentAlterSQL(TableColumnInfo info)
     Returns the SQL statement to use to add a comment to the specified column of the specified table.
public static  StringgetColumnDefaultAlterSQL(HibernateDialect dialect, TableColumnInfo info, String alterClause, boolean specifyType, String defaultClause)
    
public static  StringgetColumnDropSQL(String tableName, String columnName)
    
public static  StringgetColumnDropSQL(String tableName, String columnName, String dropClause, boolean addConstraintClause, String constraintClause)
    
public static  StringgetColumnNameAlterSQL(TableColumnInfo from, TableColumnInfo to, String alterClause, String renameToClause)
     Returns the SQL that is used to change the column name.
public static  StringgetColumnNullableAlterSQL(TableColumnInfo info, HibernateDialect dialect, String alterClause, boolean specifyType)
     Returns the SQL used to alter the specified column to allow/disallow null values.
ALTER TABLE table_name <alterClause> column_name TYPE NULL | NOT NULL
ALTER TABLE table_name <alterClause> column_name NULL | NOT NULL
Parameters:
  info - the column to modify
Parameters:
  dialect - the HibernateDialect representing the target database.
Parameters:
  alterClause - the alter column clause (e.g.
public static  StringgetColumnNullableAlterSQL(TableColumnInfo info, boolean nullable, HibernateDialect dialect, String alterClause, boolean specifyType)
     Returns the SQL used to alter the specified column to allow/disallow null values.
ALTER TABLE table_name <alterClause> column_name TYPE NULL | NOT NULL
ALTER TABLE table_name <alterClause> column_name NULL | NOT NULL
Parameters:
  info - the column to modify
Parameters:
  dialect - the HibernateDialect representing the target database.
Parameters:
  alterClause - the alter column clause (e.g.
public static  StringgetColumnRenameSQL(TableColumnInfo from, TableColumnInfo to)
     Returns the SQL that is used to change the column name.
public static  List<String>getColumnTypeAlterSQL(HibernateDialect dialect, String alterClause, String setClause, boolean repeatColumn, TableColumnInfo from, TableColumnInfo to)
     Returns the SQL that is used to change the column type.
public static  List<String>getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md, HibernateDialect dialect, CreateScriptPreferences prefs, boolean isJdbcOdbc)
    
public static  StringgetDropForeignKeySQL(String fkName, String tableName)
     Returns the SQL command to drop the specified table's foreign key constraint.
public static  StringgetDropPrimaryKeySQL(String pkName, String tableName, boolean useConstraintName, boolean cascadeConstraints)
     Returns the SQL command to drop the specified table's primary key.
public static  voidgetMultiColNotNullSQL(TableColumnInfo[] colInfos, HibernateDialect dialect, String alterClause, boolean specifyType, ArrayList<String> result)
     Populates the specified ArrayList with SQL statement(s) required to convert each of the columns to not null.
public static  TableColumnInfogetRenamedColumn(TableColumnInfo info, String newColumnName)
    
public static  List<String>getTableDropSQL(ITableInfo iTableInfo, boolean supportsCascade, boolean cascadeValue, boolean supportsMatViews, String cascadeClause, boolean isMatView)
     Returns the SQL that forms the command to drop the specified table.
public static  StringgetTypeName(TableColumnInfo info, HibernateDialect dialect)
    
public static  StringgetUnsupportedMessage(HibernateDialect dialect, int featureId)
    

Field Detail
ADD_DEFAULT_CLAUSE
final public static String ADD_DEFAULT_CLAUSE(Code)



ADD_PRIMARY_KEY_TYPE
final public static int ADD_PRIMARY_KEY_TYPE(Code)



ALTER_COLUMN_CLAUSE
final public static String ALTER_COLUMN_CLAUSE(Code)



CASCADE_CLAUSE
final public static String CASCADE_CLAUSE(Code)



CASCADE_CONSTRAINTS_CLAUSE
final public static String CASCADE_CONSTRAINTS_CLAUSE(Code)



COLUMN_CLAUSE
final public static String COLUMN_CLAUSE(Code)



COLUMN_COMMENT_ALTER_TYPE
final public static int COLUMN_COMMENT_ALTER_TYPE(Code)



COLUMN_DEFAULT_ALTER_TYPE
final public static int COLUMN_DEFAULT_ALTER_TYPE(Code)



COLUMN_DROP_TYPE
final public static int COLUMN_DROP_TYPE(Code)



COLUMN_NAME_ALTER_TYPE
final public static int COLUMN_NAME_ALTER_TYPE(Code)



COLUMN_NULL_ALTER_TYPE
final public static int COLUMN_NULL_ALTER_TYPE(Code)



COLUMN_TYPE_ALTER_TYPE
final public static int COLUMN_TYPE_ALTER_TYPE(Code)



DEFAULT_CLAUSE
final public static String DEFAULT_CLAUSE(Code)



DROP_CLAUSE
final public static String DROP_CLAUSE(Code)



DROP_COLUMN_CLAUSE
final public static String DROP_COLUMN_CLAUSE(Code)



DROP_DEFAULT_CLAUSE
final public static String DROP_DEFAULT_CLAUSE(Code)



DROP_PRIMARY_KEY_TYPE
final public static int DROP_PRIMARY_KEY_TYPE(Code)



MODIFY_CLAUSE
final public static String MODIFY_CLAUSE(Code)



MODIFY_COLUMN_CLAUSE
final public static String MODIFY_COLUMN_CLAUSE(Code)



RENAME_COLUMN_CLAUSE
final public static String RENAME_COLUMN_CLAUSE(Code)



RENAME_TO_CLAUSE
final public static String RENAME_TO_CLAUSE(Code)



SET_CLAUSE
final public static String SET_CLAUSE(Code)



SET_DATA_TYPE_CLAUSE
final public static String SET_DATA_TYPE_CLAUSE(Code)



SET_DEFAULT_CLAUSE
final public static String SET_DEFAULT_CLAUSE(Code)



TO_CLAUSE
final public static String TO_CLAUSE(Code)



TYPE_CLAUSE
final public static String TYPE_CLAUSE(Code)





Method Detail
appendDefaultClause
public static String appendDefaultClause(TableColumnInfo info, StringBuilder buffer)(Code)



createIndexes
public static List<String> createIndexes(ITableInfo ti, ISQLDatabaseMetaData md, List<PrimaryKeyInfo> primaryKeys)(Code)
Get a list of statements needed to create indexes for the specified table
Parameters:
  ti -
Parameters:
  md -
Parameters:
  primaryKeys - can be null



getAddIndexSQL
public static String getAddIndexSQL(String indexName, boolean unique, TableColumnInfo[] columns)(Code)
CREATE UNIQUE INDEX indexName ON tableName (columns);
Parameters:
  indexName -
Parameters:
  tableName -
Parameters:
  columns -



getAddPrimaryKeySQL
public static String getAddPrimaryKeySQL(ITableInfo ti, String pkName, TableColumnInfo[] colInfos, boolean appendConstraintName)(Code)
Returns the SQL for creating a primary key consisting of the specified colInfos. ALTER TABLE table_name ADD CONSTRAINT pkName PRIMARY KEY (col,...); or ALTER TABLE table_name ADD CONSTRAINT PRIMARY KEY (col,...) CONSTRAINT pkName;
Parameters:
  ti - TODO
Parameters:
  colInfos -
Parameters:
  appendConstraintName - whether or not the pkName (constraint name) should be placed at the end of the statement.



getColumnAddSQL
public static String getColumnAddSQL(TableColumnInfo info, HibernateDialect dialect, boolean addDefaultClause, boolean supportsNullQualifier, boolean addNullClause) throws UnsupportedOperationException, HibernateException(Code)
Returns the SQL statement to use to add a column to the specified table using the information about the new column specified by info.
Parameters:
  info - information about the new column such as type, name, etc.
Parameters:
  dialect - the HibernateDialect to use to resolve the type
Parameters:
  addDefaultClause - whether or not the dialect's SQL supports a DEFAULT clause for columns.
Parameters:
  addNullClause - TODO
throws:
  UnsupportedOperationException - if the database doesn't support adding columns after a table has already been created.



getColumnCommentAlterSQL
public static String getColumnCommentAlterSQL(String tableName, String columnName, String comment)(Code)
Returns the SQL statement to use to add a comment to the specified column of the specified table.
Parameters:
  tableName - the name of the table to create the SQL for.
Parameters:
  columnName - the name of the column to create the SQL for.
Parameters:
  comment - the comment to add.
throws:
  UnsupportedOperationException - if the database doesn't support annotating columns with a comment.



getColumnCommentAlterSQL
public static String getColumnCommentAlterSQL(TableColumnInfo info)(Code)
Returns the SQL statement to use to add a comment to the specified column of the specified table.
Parameters:
  tableName - the name of the table to create the SQL for.
Parameters:
  columnName - the name of the column to create the SQL for.
Parameters:
  comment - the comment to add.
throws:
  UnsupportedOperationException - if the database doesn't support annotating columns with a comment.



getColumnDefaultAlterSQL
public static String getColumnDefaultAlterSQL(HibernateDialect dialect, TableColumnInfo info, String alterClause, boolean specifyType, String defaultClause)(Code)
Returns the SQL command to change the specified column's default value ALTER TABLE table_name ALTER COLUMN column_name [defaultClause] 'defaultVal' ALTER TABLE table_name ALTER COLUMN column_name [defaultClause] 1234
Parameters:
  dialect - TODO
Parameters:
  info - the column to modify and it's default value.
Parameters:
  specifyType - TODO SQL to make the change



getColumnDropSQL
public static String getColumnDropSQL(String tableName, String columnName)(Code)

Parameters:
  tableName -
Parameters:
  columnName -



getColumnDropSQL
public static String getColumnDropSQL(String tableName, String columnName, String dropClause, boolean addConstraintClause, String constraintClause)(Code)

Parameters:
  tableName -
Parameters:
  columnName -
Parameters:
  addConstraintClause - TODO
Parameters:
  constraintClause - TODO



getColumnNameAlterSQL
public static String getColumnNameAlterSQL(TableColumnInfo from, TableColumnInfo to, String alterClause, String renameToClause)(Code)
Returns the SQL that is used to change the column name. ALTER TABLE table_name [alterClause] column_name [renameToClause] column_name
Parameters:
  from - the TableColumnInfo as it is
Parameters:
  to - the TableColumnInfo as it wants to be the SQL to make the change



getColumnNullableAlterSQL
public static String getColumnNullableAlterSQL(TableColumnInfo info, HibernateDialect dialect, String alterClause, boolean specifyType)(Code)
Returns the SQL used to alter the specified column to allow/disallow null values.
ALTER TABLE table_name <alterClause> column_name TYPE NULL | NOT NULL
ALTER TABLE table_name <alterClause> column_name NULL | NOT NULL
Parameters:
  info - the column to modify
Parameters:
  dialect - the HibernateDialect representing the target database.
Parameters:
  alterClause - the alter column clause (e.g. ALTER COLUMN )
Parameters:
  specifyType - whether or not the column type needs to be specified the SQL to execute



getColumnNullableAlterSQL
public static String getColumnNullableAlterSQL(TableColumnInfo info, boolean nullable, HibernateDialect dialect, String alterClause, boolean specifyType)(Code)
Returns the SQL used to alter the specified column to allow/disallow null values.
ALTER TABLE table_name <alterClause> column_name TYPE NULL | NOT NULL
ALTER TABLE table_name <alterClause> column_name NULL | NOT NULL
Parameters:
  info - the column to modify
Parameters:
  dialect - the HibernateDialect representing the target database.
Parameters:
  alterClause - the alter column clause (e.g. ALTER COLUMN )
Parameters:
  specifyType - whether or not the column type needs to be specified the SQL to execute



getColumnRenameSQL
public static String getColumnRenameSQL(TableColumnInfo from, TableColumnInfo to)(Code)
Returns the SQL that is used to change the column name. RENAME COLUMN table_name.column_name TO new_column_name
Parameters:
  from - the TableColumnInfo as it is
Parameters:
  to - the TableColumnInfo as it wants to be the SQL to make the change



getColumnTypeAlterSQL
public static List<String> getColumnTypeAlterSQL(HibernateDialect dialect, String alterClause, String setClause, boolean repeatColumn, TableColumnInfo from, TableColumnInfo to) throws UnsupportedOperationException(Code)
Returns the SQL that is used to change the column type. ALTER TABLE table_name alter_clause column_name [setClause] data_type ALTER TABLE table_name alter_clause column_name column_name [setClause] data_type
Parameters:
  from - the TableColumnInfo as it is
Parameters:
  to - the TableColumnInfo as it wants to be the SQL to make the change



getCreateTableSQL
public static List<String> getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md, HibernateDialect dialect, CreateScriptPreferences prefs, boolean isJdbcOdbc) throws SQLException(Code)



getDropForeignKeySQL
public static String getDropForeignKeySQL(String fkName, String tableName)(Code)
Returns the SQL command to drop the specified table's foreign key constraint.
Parameters:
  fkName - the name of the foreign key that should be dropped
Parameters:
  tableName - the name of the table whose foreign key should be dropped



getDropPrimaryKeySQL
public static String getDropPrimaryKeySQL(String pkName, String tableName, boolean useConstraintName, boolean cascadeConstraints)(Code)
Returns the SQL command to drop the specified table's primary key. alter table table_name drop primary key or alter table table_name drop constraint [pkName]
Parameters:
  pkName - the name of the primary key that should be dropped
Parameters:
  tableName - the name of the table whose primary key should be dropped
Parameters:
  useConstraintName - if true, the constraint name is used - like 'DROP CONSTRAINT pkName'; otherwisea generic 'DROP PRIMARY KEY' is used instead.
Parameters:
  cascadeConstraints - whether or not to append 'CASCADE' to the end.



getMultiColNotNullSQL
public static void getMultiColNotNullSQL(TableColumnInfo[] colInfos, HibernateDialect dialect, String alterClause, boolean specifyType, ArrayList<String> result)(Code)
Populates the specified ArrayList with SQL statement(s) required to convert each of the columns to not null. This is typically needed in some databases when adding a primary key (some dbs do this step automatically)
Parameters:
  colInfos - the columns to be made not null
Parameters:
  dialect -
Parameters:
  result -



getRenamedColumn
public static TableColumnInfo getRenamedColumn(TableColumnInfo info, String newColumnName)(Code)



getTableDropSQL
public static List<String> getTableDropSQL(ITableInfo iTableInfo, boolean supportsCascade, boolean cascadeValue, boolean supportsMatViews, String cascadeClause, boolean isMatView)(Code)
Returns the SQL that forms the command to drop the specified table. If cascade contraints is supported by the dialect and cascadeConstraints is true, then a drop statement with cascade constraints clause will be formed.
Parameters:
  iTableInfo - the table to drop
Parameters:
  supportsCascade - whether or not the cascade clause should be added.
Parameters:
  cascadeValue - whether or not to drop any FKs that may reference the specified table.
Parameters:
  supportsMatViews - TODO
Parameters:
  cascadeClause - TODO
Parameters:
  isMatView - TODO the drop SQL command.



getTypeName
public static String getTypeName(TableColumnInfo info, HibernateDialect dialect)(Code)



getUnsupportedMessage
public static String getUnsupportedMessage(HibernateDialect dialect, int featureId) throws UnsupportedOperationException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.