cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1171140 - in /cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools: DbGeneratorMojo.java DbImporterMojo.java
Date Thu, 15 Sep 2011 15:36:07 GMT
Author: dkazimirchyk
Date: Thu Sep 15 15:36:07 2011
New Revision: 1171140

URL: http://svn.apache.org/viewvc?rev=1171140&view=rev
Log:
CAY-1619 AdhocObjectFactory: passing factory.newInstance() as parameter causes compilation
error

Modified:
    cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
    cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java

Modified: cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java?rev=1171140&r1=1171139&r2=1171140&view=diff
==============================================================================
--- cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
(original)
+++ cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
Thu Sep 15 15:36:07 2011
@@ -148,8 +148,8 @@ public class DbGeneratorMojo extends Abs
 
         try {
             final DbAdapter adapterInst = (adapter == null) ? 
-            		objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName()) : 
-            		objectFactory.newInstance(DbAdapter.class, adapter);
+            		(DbAdapter)objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName())
: 
+            		(DbAdapter)objectFactory.newInstance(DbAdapter.class, adapter);
 
             // Load the data map and run the db generator.
             DataMap dataMap = loadDataMap();

Modified: cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java?rev=1171140&r1=1171139&r2=1171140&view=diff
==============================================================================
--- cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
(original)
+++ cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
Thu Sep 15 15:36:07 2011
@@ -192,8 +192,8 @@ public class DbImporterMojo extends Abst
 
         try {
             final DbAdapter adapterInst = (adapter == null) ? 
-                    objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName())
: 
-                    objectFactory.newInstance(DbAdapter.class, adapter);
+                    (DbAdapter)objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName())
: 
+                    (DbAdapter)objectFactory.newInstance(DbAdapter.class, adapter);
 
             // load driver taking custom CLASSPATH into account...
             DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(driver).newInstance(),
url, username, password);



Mime
View raw message