Revision: 6155
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6155&view=rev
Author: manningr
Date: 2011-02-13 16:04:52 +0000 (Sun, 13 Feb 2011)
Log Message:
-----------
A wrapper class for inject-able instances of IDialectFactory that allows the coupling between static DialectFactory methods and many other classes to be removed.
Added Paths:
-----------
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectFactoryImpl.java
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/IDialectFactory.java
Added: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectFactoryImpl.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectFactoryImpl.java (rev 0)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectFactoryImpl.java 2011-02-13 16:04:52 UTC (rev 6155)
@@ -0,0 +1,321 @@
+package net.sourceforge.squirrel_sql.fw.dialects;
+
+import javax.swing.JFrame;
+
+import net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData;
+
+/*
+ * Copyright (C) 2010 Rob Manning
+ * man...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * An implementation of IDialectFactory that delegates to DialectFactory. Since DialectFactory is mostly
+ * static, and performs some static initialization that cannot be undone once initialized, this wrapper allows
+ * classes to have a non-static IDialectFactory injected, rather than rely on the static methods in
+ * DialectFactory which is essentially a big and complex global variable. This means that alternative (for
+ * example, mock) implementations can be substituted for the real DialectFactory, when testing if a real
+ * DialectFactory isn't needed for test purposes.
+ */
+public class DialectFactoryImpl implements IDialectFactory
+{
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isAxion(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isAxion(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isAxion(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isDaffodil(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isDaffodil(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isDaffodil(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isDB2(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isDB2(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isDB2(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isDerby(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isDerby(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isDerby(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isFirebird(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isFirebird(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isFirebird(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isFrontBase(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isFrontBase(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isFrontBase(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isHADB(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isHADB(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isHADB(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isH2(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isH2(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isH2(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isHSQL(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isHSQL(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isHSQL(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isInformix(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isInformix(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isInformix(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isIngres(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isIngres(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isIngres(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isInterbase(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isInterbase(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isInterbase(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isIntersystemsCacheDialectExt(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isIntersystemsCacheDialectExt(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isIntersystemsCacheDialectExt(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isMaxDB(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isMaxDB(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isMaxDB(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isMcKoi(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isMcKoi(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isMcKoi(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isMSSQLServer(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isMSSQLServer(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isMSSQLServer(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isMySQL(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isMySQL(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isMySQL(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isMySQL5(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isMySQL5(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isMySQL5(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isNetezza(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isNetezza(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isNetezza(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isOracle(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isOracle(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isOracle(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isPointbase(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isPointbase(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isPointbase(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isPostgreSQL(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isPostgreSQL(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isPostgreSQL(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isProgress(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isProgress(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isProgress(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isSyBase(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isSyBase(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isSyBase(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * isTimesTen(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public boolean isTimesTen(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.isTimesTen(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * getDialectType(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public DialectType getDialectType(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.getDialectType(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#getDialect(java.lang.String)
+ */
+ public HibernateDialect getDialect(String dbName)
+ {
+ return DialectFactory.getDialect(dbName);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#getDialectIgnoreCase(java.lang.String)
+ */
+ public HibernateDialect getDialectIgnoreCase(String dbName)
+ {
+ return DialectFactory.getDialectIgnoreCase(dbName);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#
+ * getDialect(net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public HibernateDialect getDialect(ISQLDatabaseMetaData md)
+ {
+ return DialectFactory.getDialect(md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#getDialect(int, javax.swing.JFrame,
+ * net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
+ */
+ public HibernateDialect getDialect(int sessionType, JFrame parent, ISQLDatabaseMetaData md)
+ throws UserCancelledOperationException
+ {
+ return DialectFactory.getDialect(sessionType, parent, md);
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#getDbNames()
+ */
+ public Object[] getDbNames()
+ {
+ return DialectFactory.getDbNames();
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.IDialectFactory#getSupportedDialects()
+ */
+ public Object[] getSupportedDialects()
+ {
+ return DialectFactory.getSupportedDialects();
+ }
+}
Added: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/IDialectFactory.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/IDialectFactory.java (rev 0)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/IDialectFactory.java 2011-02-13 16:04:52 UTC (rev 6155)
@@ -0,0 +1,359 @@
+package net.sourceforge.squirrel_sql.fw.dialects;
+
+import javax.swing.JFrame;
+
+import net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData;
+
+/*
+ * Copyright (C) 2010 Rob Manning
+ * man...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * An interface for a non-static inject-able DialectFactory.
+ */
+public interface IDialectFactory
+{
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Axion
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isAxion(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Daffodil
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isDaffodil(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is DB2
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isDB2(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is derby
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isDerby(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is firebird
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isFirebird(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is frontbase
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isFrontBase(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is HADB
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isHADB(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is H2
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isH2(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is HSQL
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isHSQL(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Informix
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isInformix(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Ingres
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isIngres(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Interbase
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isInterbase(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is
+ * InterSystems Cache
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isIntersystemsCacheDialectExt(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is MaxDB
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isMaxDB(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is McKoi
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isMcKoi(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is MSSQL
+ * Server
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isMSSQLServer(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is MySQL 4 or
+ * below
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isMySQL(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is MySQL 5
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isMySQL5(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Netezza
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isNetezza(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Oracle
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isOracle(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Pointbase
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isPointbase(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is PostgreSQL
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isPostgreSQL(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Progress
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isProgress(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is SyBase
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isSyBase(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a boolean value indicating whether or not the specified metadata indicates that it is Oracle
+ * Times Ten
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return boolean indicating whether or not the specified metadata matches the database type
+ */
+ boolean isTimesTen(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns a DialectType for the specified ISQLDatabaseMetaData
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return a dialect type
+ */
+ DialectType getDialectType(ISQLDatabaseMetaData md);
+
+ /**
+ * Returns the HibernateDialect that corresponds with the specified database display name.
+ *
+ * @param dbName
+ * the database display name
+ * @return a HibernateDialect matching the specified database display name exactly, or null.
+ */
+ HibernateDialect getDialect(String dbName);
+
+ /**
+ * Returns the HibernateDialect that corresponds with the specified metadata.
+ *
+ * @param dbName
+ * the database display name
+ * @return a HibernateDialect matching the specified database display name ignoring case, or null.
+ */
+ HibernateDialect getDialectIgnoreCase(String dbName);
+
+ /**
+ * Returns the HibernateDialect that corresponds with the specified metadata.
+ *
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return the HibernateDialect that corresponds with the specified metadata. If no specific implementation
+ * matches the specified metadata, then a generic dialect is returned.
+ */
+ HibernateDialect getDialect(ISQLDatabaseMetaData md);
+
+ /**
+ * Shows the user a dialog explaining that we failed to detect the dialect of the destination database, and
+ * we are offering the user the opportunity to pick one from our supported dialects list. If the user
+ * cancels this dialog, null is returned to indicate that the user doesn't wish to continue the paste
+ * operation.
+ *
+ * @param sessionType
+ * the type of the session (source or destination). This is a left over from DBCopy Plugin and
+ * should be refactored to not need this at some point.
+ * @param parent
+ * the JFrame to use to display the dialog over.
+ * @param md
+ * The SQLDatabaseMetaData retrieved from either ISQLConnection.getSQLMetaData() or
+ * ISession.getMetaData()
+ * @return the dialect that the user picked.
+ */
+ HibernateDialect getDialect(int sessionType, JFrame parent, ISQLDatabaseMetaData md)
+ throws UserCancelledOperationException;
+
+ /**
+ * Returns a list of Database display names that can be presented to the user whenever we want the user to
+ * pick a dialect. It is from this list, that the string parameter in getDialect(String) should be chosen.
+ *
+ * @return a list of database display names
+ */
+ Object[] getDbNames();
+
+ /**
+ * Returns an array of HibernateDialect instances, one for each supported dialect.
+ *
+ * @return an array of HibernateDialect instances. This array doesn't include the generic dialect.
+ */
+ Object[] getSupportedDialects();
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|