cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1358358 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba: ./ db2/ derby/ frontbase/ h2/ hsqldb/ ingres/ mysql/ openbase/ oracle/ postgres/ sqlite/ sqlserver/ sybase/
Date Fri, 06 Jul 2012 19:12:38 GMT
Author: aadamchik
Date: Fri Jul  6 19:12:37 2012
New Revision: 1358358

URL: http://svn.apache.org/viewvc?rev=1358358&view=rev
Log:
CAY-1718 Remove everything deprecated in 3.1

in progress

Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,17 +24,16 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
 /**
  * @since 1.2
  */
-public class DB2Sniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class DB2Sniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public DB2Sniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -42,7 +41,9 @@ public class DB2Sniffer implements DbAda
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("DB2")
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, DB2Adapter.class.getName())
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        DB2Adapter.class.getName())
                 : null;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -33,10 +32,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class DerbySniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class DerbySniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public DerbySniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -44,7 +43,8 @@ public class DerbySniffer implements DbA
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("APACHE DERBY")
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, DerbyAdapter.class.getName())
-                : null;
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        DerbyAdapter.class.getName()) : null;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,17 +24,16 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
 /**
  * @since 1.2
  */
-public class FrontBaseSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class FrontBaseSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public FrontBaseSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -42,9 +41,8 @@ public class FrontBaseSniffer implements
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("FRONTBASE")
-                ? (DbAdapter)objectFactory.newInstance(
-                        DbAdapter.class, 
-                        FrontBaseAdapter.class.getName())
-                : null;
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        FrontBaseAdapter.class.getName()) : null;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,17 +24,16 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
 /**
  * @since 3.0
  */
-public class H2Sniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class H2Sniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public H2Sniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -42,7 +41,9 @@ public class H2Sniffer implements DbAdap
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("H2")
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, H2Adapter.class.getName())
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        H2Adapter.class.getName())
                 : null;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -33,10 +32,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class HSQLDBSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class HSQLDBSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public HSQLDBSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -62,11 +61,11 @@ public class HSQLDBSniffer implements Db
         else {
             supportsSchema = false;
         }
-        
-        return supportsSchema
-            ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, HSQLDBAdapter.class.getName())
-            : (DbAdapter)objectFactory.newInstance(
-                    DbAdapter.class, 
-                    HSQLDBNoSchemaAdapter.class.getName());
+
+        return supportsSchema ? (DbAdapter) objectFactory.newInstance(
+                DbAdapter.class,
+                HSQLDBAdapter.class.getName()) : (DbAdapter) objectFactory.newInstance(
+                DbAdapter.class,
+                HSQLDBNoSchemaAdapter.class.getName());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -33,10 +32,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class IngresSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class IngresSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public IngresSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -44,7 +43,8 @@ public class IngresSniffer implements Db
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("INGRES")
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, IngresAdapter.class.getName())
-                : null;
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        IngresAdapter.class.getName()) : null;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java
Fri Jul  6 19:12:37 2012
@@ -26,7 +26,6 @@ import java.sql.Statement;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -35,10 +34,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class MySQLSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class MySQLSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public MySQLSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -78,7 +77,7 @@ public class MySQLSniffer implements DbA
         }
 
         MySQLAdapter adapter = objectFactory.newInstance(
-                MySQLAdapter.class, 
+                MySQLAdapter.class,
                 MySQLAdapter.class.getName());
         adapter.setSupportsFkConstraints(supportFK);
         adapter.setStorageEngine(adapterStorageEngine);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -33,10 +32,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class OpenBaseSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class OpenBaseSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public OpenBaseSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -44,8 +43,9 @@ public class OpenBaseSniffer implements 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("OPENBASE")
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, OpenBaseAdapter.class.getName())
-                : null;
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        OpenBaseAdapter.class.getName()) : null;
     }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,17 +24,16 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
 /**
  * @since 1.2
  */
-public class OracleSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class OracleSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public OracleSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -45,8 +44,10 @@ public class OracleSniffer implements Db
             return null;
         }
 
-        return (md.getDriverMajorVersion() <= 8)
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, Oracle8Adapter.class.getName())
-                : (DbAdapter)objectFactory.newInstance(DbAdapter.class, OracleAdapter.class.getName());
+        return (md.getDriverMajorVersion() <= 8) ? (DbAdapter) objectFactory.newInstance(
+                DbAdapter.class,
+                Oracle8Adapter.class.getName()) : (DbAdapter) objectFactory.newInstance(
+                DbAdapter.class,
+                OracleAdapter.class.getName());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,17 +24,16 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
 /**
  * @since 1.2
  */
-public class PostgresSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class PostgresSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public PostgresSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -42,7 +41,8 @@ public class PostgresSniffer implements 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();
         return dbName != null && dbName.toUpperCase().contains("POSTGRESQL")
-                ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, PostgresAdapter.class.getName())
-                : null;
+                ? (DbAdapter) objectFactory.newInstance(
+                        DbAdapter.class,
+                        PostgresAdapter.class.getName()) : null;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java
Fri Jul  6 19:12:37 2012
@@ -23,7 +23,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -32,10 +31,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 3.0
  */
-public class SQLiteSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class SQLiteSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public SQLiteSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -46,6 +45,6 @@ public class SQLiteSniffer implements Db
             return null;
         }
 
-        return (DbAdapter)objectFactory.newInstance(DbAdapter.class, SQLiteAdapter.class.getName());
+        return objectFactory.newInstance(DbAdapter.class, SQLiteAdapter.class.getName());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -33,10 +32,10 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class SQLServerSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class SQLServerSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public SQLServerSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
@@ -48,7 +47,7 @@ public class SQLServerSniffer implements
         }
 
         SQLServerAdapter adapter = objectFactory.newInstance(
-                SQLServerAdapter.class, 
+                SQLServerAdapter.class,
                 SQLServerAdapter.class.getName());
 
         // detect whether generated keys are supported

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java?rev=1358358&r1=1358357&r2=1358358&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java
Fri Jul  6 19:12:37 2012
@@ -24,7 +24,6 @@ import java.sql.SQLException;
 
 import org.apache.cayenne.configuration.server.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 
@@ -33,28 +32,30 @@ import org.apache.cayenne.di.Inject;
  * 
  * @since 1.2
  */
-public class SybaseSniffer implements DbAdapterFactory, DbAdapterDetector {
-    
+public class SybaseSniffer implements DbAdapterDetector {
+
     protected AdhocObjectFactory objectFactory;
-    
+
     public SybaseSniffer(@Inject AdhocObjectFactory objectFactory) {
         this.objectFactory = objectFactory;
     }
 
-    public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {    	
-    	// JTDS driver returns "sql server" for Sybase, so need to handle it differently
-    	String driver = md.getDriverName();
-    	if(driver != null && driver.toLowerCase().startsWith("jtds")) {
-    		String url = md.getURL();
-    		return url != null && url.toLowerCase().startsWith("jdbc:jtds:sybase:")
-    		        ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, SybaseAdapter.class.getName())
-                    : null;
-    	}
-    	else {
+    public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
+        // JTDS driver returns "sql server" for Sybase, so need to handle it differently
+        String driver = md.getDriverName();
+        if (driver != null && driver.toLowerCase().startsWith("jtds")) {
+            String url = md.getURL();
+            return url != null && url.toLowerCase().startsWith("jdbc:jtds:sybase:")
+                    ? (DbAdapter) objectFactory.newInstance(
+                            DbAdapter.class,
+                            SybaseAdapter.class.getName()) : null;
+        }
+        else {
             String dbName = md.getDatabaseProductName();
             return dbName != null && dbName.toUpperCase().contains("ADAPTIVE SERVER")
-                    ? (DbAdapter)objectFactory.newInstance(DbAdapter.class, SybaseAdapter.class.getName())
-                    : null;
-    	}
+                    ? (DbAdapter) objectFactory.newInstance(
+                            DbAdapter.class,
+                            SybaseAdapter.class.getName()) : null;
+        }
     }
 }



Mime
View raw message