cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1170706 [1/2] - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/access/trans/ main/java/org/apache/cayenne/dba/ main/java/org/apache/cayenne/dba/db2/ m...
Date Wed, 14 Sep 2011 16:41:05 GMT
Author: dkazimirchyk
Date: Wed Sep 14 16:41:03 2011
New Revision: 1170706

URL: http://svn.apache.org/viewvc?rev=1170706&view=rev
Log:
CAY-1210 mysql does not use index for case insensitive searches

case-insensitive-search.patch with some changes

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Adapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBNoSchemaAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLConditionTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLQualifierTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/JdbcAdapterTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/postgres/PostgresAdapterTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapterTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java Wed Sep 14 16:41:03 2011
@@ -390,7 +390,7 @@ public class EJBQLConditionTranslator ex
      * For that, we'll append IS NULL or IS NOT NULL instead of =null or <>null
      * @return whether replacement was done and there's no need for normal expression processing
      */
-    boolean checkNullParameter(EJBQLExpression expression, String toAppend) {
+    protected boolean checkNullParameter(EJBQLExpression expression, String toAppend) {
         if (expression.getChildrenCount() == 2) {
             // We rewrite expression "parameter = :x" where x=null
             // as "parameter IS NULL"

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java Wed Sep 14 16:41:03 2011
@@ -56,6 +56,7 @@ public class EJBQLTranslationContext {
     private Map<String, String> idAliases;
     private int resultDescriptorPosition;
     private boolean usingAliases;
+    private boolean caseInsensitive;
     private List<StringBuilder> bufferStack;
     private List<StringBuilder> bufferChain;
     private StringBuilder stackTop;
@@ -78,6 +79,7 @@ public class EJBQLTranslationContext {
         this.positionalParameters = query.getPositionalParameters();
         this.translatorFactory = translatorFactory;
         this.usingAliases = true;
+        this.caseInsensitive = false;
         this.queryMetadata = query.getMetaData(entityResolver);
         // buffer stack will hold named buffers during translation in the order they were
         // requested
@@ -427,6 +429,14 @@ public class EJBQLTranslationContext {
     public void setUsingAliases(boolean useAliases) {
         this.usingAliases = useAliases;
     }
+    
+    public boolean isCaseInsensitive() {
+        return caseInsensitive;
+    }
+    
+    public void setCaseInsensitive(boolean caseInsensitive) {
+        this.caseInsensitive = caseInsensitive;
+    }
 
     public void onSubselect() {
         subselectCount++;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java Wed Sep 14 16:41:03 2011
@@ -28,6 +28,8 @@ import org.apache.cayenne.ejbql.EJBQLExp
 public class JdbcEJBQLTranslatorFactory implements EJBQLTranslatorFactory {
 
     protected static final String JOIN_APPENDER_KEY = "$JoinAppender";
+    
+    protected boolean caseInsensitive = false;
 
     public EJBQLJoinAppender getJoinAppender(EJBQLTranslationContext context) {
         EJBQLJoinAppender appender = (EJBQLJoinAppender) context
@@ -61,6 +63,7 @@ public class JdbcEJBQLTranslatorFactory 
     }
 
     public EJBQLExpressionVisitor getConditionTranslator(EJBQLTranslationContext context) {
+        context.setCaseInsensitive(caseInsensitive);
         return new EJBQLConditionTranslator(context);
     }
 
@@ -94,4 +97,8 @@ public class JdbcEJBQLTranslatorFactory 
     public EJBQLExpressionVisitor getUpdateItemTranslator(EJBQLTranslationContext context) {
         return new EJBQLUpdateItemTranslator(context);
     }
+    
+    public void setCaseInsensitive(boolean caseInsensitive) {
+        this.caseInsensitive = caseInsensitive;
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java Wed Sep 14 16:41:03 2011
@@ -49,9 +49,12 @@ public class QualifierTranslator extends
 
     protected DataObjectMatchTranslator objectMatchTranslator;
     protected boolean matchingObject;
+    protected boolean caseInsensitive;
 
     public QualifierTranslator(QueryAssembler queryAssembler) {
         super(queryAssembler);
+        
+        caseInsensitive = false;
     }
 
     /**
@@ -64,6 +67,10 @@ public class QualifierTranslator extends
     protected void doAppendPart() throws IOException {
         doAppendPart(extractQualifier());
     }
+    
+    public void setCaseInsensitive(boolean caseInsensitive) {
+        this.caseInsensitive = caseInsensitive;
+    }
 
     /**
      * Translates query qualifier to SQL WHERE clause. Qualifier is a method parameter.
@@ -253,10 +260,20 @@ public class QualifierTranslator extends
                     out.append(" NOT LIKE ");
                     break;
                 case Expression.LIKE_IGNORE_CASE:
-                    out.append(") LIKE UPPER(");
+                    if (caseInsensitive) {
+                        out.append(" LIKE ");
+                    }
+                    else {
+                        out.append(") LIKE UPPER(");
+                    }
                     break;
                 case Expression.NOT_LIKE_IGNORE_CASE:
-                    out.append(") NOT LIKE UPPER(");
+                    if (caseInsensitive) {
+                        out.append(" NOT LIKE ");
+                    }
+                    else {
+                        out.append(") NOT LIKE UPPER(");
+                    }
                     break;
                 case Expression.ADD:
                     out.append(" + ");
@@ -327,8 +344,9 @@ public class QualifierTranslator extends
                 else if (node.getType() == Expression.NOT)
                     out.append("NOT ");
             }
-            else if (node.getType() == Expression.LIKE_IGNORE_CASE
-                    || node.getType() == Expression.NOT_LIKE_IGNORE_CASE) {
+            else if ((node.getType() == Expression.LIKE_IGNORE_CASE
+                    || node.getType() == Expression.NOT_LIKE_IGNORE_CASE)
+                    && !caseInsensitive) {
                 out.append("UPPER(");
             }
         }
@@ -361,7 +379,7 @@ public class QualifierTranslator extends
             if (isPatternMatchNode && !likeIgnoreCase)
                 appendLikeEscapeCharacter((PatternMatchNode) node);
             
-            if (likeIgnoreCase)
+            if (likeIgnoreCase && !caseInsensitive)
                 out.append(')');
 
             if (isPatternMatchNode && likeIgnoreCase)

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java Wed Sep 14 16:41:03 2011
@@ -36,6 +36,7 @@ import org.apache.cayenne.access.trans.Q
 import org.apache.cayenne.access.trans.QueryAssembler;
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
@@ -55,6 +56,9 @@ import org.apache.cayenne.util.Util;
  * of a concrete adapter implementation.
  */
 public class JdbcAdapter implements DbAdapter {
+    
+    // defines if database uses case-insensitive collation
+    public final static String CI_PROPERTY = "cayenne.runtime.db.collation.assume.ci";
 
     final static String DEFAULT_IDENTIFIERS_START_QUOTE = "\"";
     final static String DEFAULT_IDENTIFIERS_END_QUOTE = "\"";
@@ -72,6 +76,7 @@ public class JdbcAdapter implements DbAd
     protected String identifiersEndQuote;
 
     protected ResourceLocator resourceLocator;
+    protected RuntimeProperties runtimeProperties;
 
     /**
      * @since 3.1
@@ -99,19 +104,20 @@ public class JdbcAdapter implements DbAd
     /**
      * Creates new JdbcAdapter with a set of default parameters.
      */
-    public JdbcAdapter() {
+    public JdbcAdapter(@Inject RuntimeProperties runtimeProperties) {
         // init defaults
         this.setSupportsBatchUpdates(false);
         this.setSupportsUniqueConstraints(true);
+        this.runtimeProperties = runtimeProperties;
 
         // TODO: andrus 05.02.2010 - ideally this should be injected
         this.resourceLocator = new ClassLoaderResourceLocator();
         
         this.pkGenerator = createPkGenerator();
+        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
         this.typesHandler = TypesHandler.getHandler(findResource("/types.xml"));
         this.extendedTypes = new ExtendedTypeMap();
         this.configureExtendedTypes(extendedTypes);
-        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
         initIdentifiersQuotes();
     }
 
@@ -185,7 +191,11 @@ public class JdbcAdapter implements DbAd
      * @since 3.0
      */
     protected EJBQLTranslatorFactory createEJBQLTranslatorFactory() {
-        return new JdbcEJBQLTranslatorFactory();
+        JdbcEJBQLTranslatorFactory translatorFactory = 
+                new JdbcEJBQLTranslatorFactory();
+        translatorFactory.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translatorFactory;
     }
 
     /**
@@ -503,7 +513,9 @@ public class JdbcAdapter implements DbAd
      * Creates and returns a default implementation of a qualifier translator.
      */
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new QualifierTranslator(queryAssembler);
+        QualifierTranslator translator = new QualifierTranslator(queryAssembler);
+        translator.setCaseInsensitive(runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java Wed Sep 14 16:41:03 2011
@@ -31,10 +31,12 @@ import org.apache.cayenne.access.types.B
 import org.apache.cayenne.access.types.ByteArrayType;
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.merge.MergerFactory;
@@ -55,7 +57,8 @@ import org.apache.cayenne.merge.MergerFa
  */
 public class DB2Adapter extends JdbcAdapter {
 
-    public DB2Adapter() {
+    public DB2Adapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
         setSupportsGeneratedKeys(true);
     }
 
@@ -194,7 +197,10 @@ public class DB2Adapter extends JdbcAdap
      */
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new DB2QualifierTranslator(queryAssembler, "RTRIM");
+        QualifierTranslator translator = new DB2QualifierTranslator(queryAssembler, "RTRIM");
+        translator.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 
     final class DB2BooleanType extends BooleanType {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java Wed Sep 14 16:41:03 2011
@@ -31,10 +31,12 @@ import org.apache.cayenne.access.types.B
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
 import org.apache.cayenne.access.types.ShortType;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.merge.MergerFactory;
@@ -64,7 +66,8 @@ public class DerbyAdapter extends JdbcAd
 
     static final String FOR_BIT_DATA_SUFFIX = " FOR BIT DATA";
 
-    public DerbyAdapter() {
+    public DerbyAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
         setSupportsGeneratedKeys(true);
         setSupportsBatchUpdates(true);
     }
@@ -185,7 +188,9 @@ public class DerbyAdapter extends JdbcAd
      */
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new DerbyQualifierTranslator(queryAssembler, "RTRIM");
+        QualifierTranslator translator = new DerbyQualifierTranslator(queryAssembler, "RTRIM");
+        translator.setCaseInsensitive(runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
     
     @Override

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java Wed Sep 14 16:41:03 2011
@@ -27,10 +27,12 @@ import java.util.Iterator;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.query.Query;
@@ -58,7 +60,8 @@ import org.apache.cayenne.query.SQLActio
 // what to do about it.
 public class FrontBaseAdapter extends JdbcAdapter {
 
-    public FrontBaseAdapter() {
+    public FrontBaseAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
         setSupportsBatchUpdates(true);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Adapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Adapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Adapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Adapter.java Wed Sep 14 16:41:03 2011
@@ -19,7 +19,9 @@
 
 package org.apache.cayenne.dba.h2;
 
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.merge.MergerFactory;
 
@@ -27,7 +29,8 @@ import org.apache.cayenne.merge.MergerFa
  * @since 3.0
  */
 public class H2Adapter extends JdbcAdapter {
-    public H2Adapter() {
+    public H2Adapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
         setSupportsGeneratedKeys(true);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java Wed Sep 14 16:41:03 2011
@@ -25,8 +25,10 @@ import java.util.Iterator;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.QuotingStrategy;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;
@@ -48,6 +50,10 @@ import org.apache.cayenne.query.SQLActio
  * </pre>
  */
 public class HSQLDBAdapter extends JdbcAdapter {
+    
+    public HSQLDBAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+    }
 
     /**
      * Generate fully-qualified name for 1.8 and on. Subclass generates unqualified name.

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBNoSchemaAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBNoSchemaAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBNoSchemaAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBNoSchemaAdapter.java Wed Sep 14 16:41:03 2011
@@ -22,6 +22,8 @@ package org.apache.cayenne.dba.hsqldb;
 import java.util.Collection;
 import java.util.Collections;
 
+import org.apache.cayenne.configuration.RuntimeProperties;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbEntity;
 
 /**
@@ -30,6 +32,10 @@ import org.apache.cayenne.map.DbEntity;
  * @since 1.2
  */
 public class HSQLDBNoSchemaAdapter extends HSQLDBAdapter {
+    
+    public HSQLDBNoSchemaAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+    }
 
     /**
      * Generate unqualified name without schema.

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java Wed Sep 14 16:41:03 2011
@@ -26,10 +26,12 @@ import org.apache.cayenne.access.trans.Q
 import org.apache.cayenne.access.trans.QueryAssembler;
 import org.apache.cayenne.access.trans.TrimmingQualifierTranslator;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 
@@ -48,6 +50,10 @@ import org.apache.cayenne.map.DbEntity;
 public class IngresAdapter extends JdbcAdapter {
     public static final String TRIM_FUNCTION = "TRIM";
     
+    public IngresAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+    }
+    
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
         return new TrimmingQualifierTranslator(

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java Wed Sep 14 16:41:03 2011
@@ -31,15 +31,18 @@ import java.util.List;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.jdbc.EJBQLTranslatorFactory;
+import org.apache.cayenne.access.jdbc.JdbcEJBQLTranslatorFactory;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
 import org.apache.cayenne.access.types.ByteArrayType;
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
@@ -76,7 +79,8 @@ public class MySQLAdapter extends JdbcAd
     protected String storageEngine;
     protected boolean supportsFkConstraints;
 
-    public MySQLAdapter() {
+    public MySQLAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
 
         // init defaults
         this.storageEngine = DEFAULT_STORAGE_ENGINE;
@@ -100,7 +104,9 @@ public class MySQLAdapter extends JdbcAd
     
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new MySQLQualifierTranslator(queryAssembler);
+        QualifierTranslator translator = new MySQLQualifierTranslator(queryAssembler);
+        translator.setCaseInsensitive(runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 
     /**
@@ -219,7 +225,11 @@ public class MySQLAdapter extends JdbcAd
      */
     @Override
     protected EJBQLTranslatorFactory createEJBQLTranslatorFactory() {
-        return new MySQLEJBQLTranslatorFactory();
+        JdbcEJBQLTranslatorFactory translatorFactory = 
+                new MySQLEJBQLTranslatorFactory();
+        translatorFactory.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translatorFactory;
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLConditionTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLConditionTranslator.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLConditionTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLConditionTranslator.java Wed Sep 14 16:41:03 2011
@@ -71,4 +71,24 @@ class MySQLEJBQLConditionTranslator exte
         context.append("BOTH");
         return false;
     }
+    
+    @Override
+    public boolean visitLike(EJBQLExpression expression, int finishedChildIndex) {
+        if (finishedChildIndex == 0) {
+            if (checkNullParameter(expression, " IS NULL")) {
+                return false;
+            }
+            
+            if (expression.isNegated()) {
+                context.append(" NOT");
+            }
+            context.append(" LIKE");
+            
+            if (context.isCaseInsensitive()) {
+                context.append(" BINARY");
+            }
+        }
+
+        return true;
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java Wed Sep 14 16:41:03 2011
@@ -29,6 +29,7 @@ class MySQLEJBQLTranslatorFactory extend
 
     @Override
     public EJBQLExpressionVisitor getConditionTranslator(EJBQLTranslationContext context) {
+        context.setCaseInsensitive(caseInsensitive);
         return new MySQLEJBQLConditionTranslator(context);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLQualifierTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLQualifierTranslator.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLQualifierTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLQualifierTranslator.java Wed Sep 14 16:41:03 2011
@@ -23,6 +23,7 @@ import java.io.IOException;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
+import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.parser.PatternMatchNode;
 
 class MySQLQualifierTranslator extends QualifierTranslator {
@@ -51,4 +52,40 @@ class MySQLQualifierTranslator extends Q
         }
     }
 
+    @Override
+    public void finishedChild(Expression node, int childIndex, boolean hasMoreChildren) {
+        
+        if (!caseInsensitive) {
+            super.finishedChild(node, childIndex, hasMoreChildren);
+        }
+        else {
+            
+            if (!hasMoreChildren) {
+                return;
+            }
+            
+            // if we have something except LIKE or NOT LIKE then no need in specific handling
+            if (node.getType() != Expression.LIKE
+                    && node.getType() != Expression.NOT_LIKE) {
+                super.finishedChild(node, childIndex, hasMoreChildren);
+                return;
+            }
+            
+            try {
+                Appendable out = (matchingObject) ? new StringBuilder() : this.out;
+                
+                switch (node.getType()) {
+                    case Expression.LIKE:
+                        out.append(" LIKE BINARY ");
+                        break;
+                    case Expression.NOT_LIKE:
+                        out.append(" NOT LIKE BINARY ");
+                        break;
+                }
+            }
+            catch (IOException ioex) {
+                throw new CayenneRuntimeException("Error appending content", ioex);
+            }
+        }
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java Wed Sep 14 16:41:03 2011
@@ -32,10 +32,12 @@ import org.apache.cayenne.access.trans.Q
 import org.apache.cayenne.access.types.ByteType;
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;
@@ -60,7 +62,9 @@ import org.apache.cayenne.query.SQLActio
  */
 public class OpenBaseAdapter extends JdbcAdapter {
 
-    public OpenBaseAdapter() {
+    public OpenBaseAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+        
         // init defaults
         this.setSupportsUniqueConstraints(false);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java Wed Sep 14 16:41:03 2011
@@ -25,6 +25,8 @@ import java.net.URL;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
+import org.apache.cayenne.configuration.RuntimeProperties;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 
@@ -41,6 +43,10 @@ public class Oracle8Adapter extends Orac
     static {
         initOracle8DriverInformation();
     }
+    
+    public Oracle8Adapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+    }
 
     private static void initOracle8DriverInformation() {
         initDone = true;
@@ -86,6 +92,9 @@ public class Oracle8Adapter extends Orac
 
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new Oracle8QualifierTranslator(queryAssembler);
+        QualifierTranslator translator = new Oracle8QualifierTranslator(queryAssembler);
+        translator.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java Wed Sep 14 16:41:03 2011
@@ -39,9 +39,11 @@ import org.apache.cayenne.access.types.B
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
 import org.apache.cayenne.access.types.ShortType;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.merge.MergerFactory;
@@ -152,7 +154,9 @@ public class OracleAdapter extends JdbcA
         return oracleCursorType;
     }
 
-    public OracleAdapter() {
+    public OracleAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+        
         // enable batch updates by default
         setSupportsBatchUpdates(true);
     }
@@ -288,7 +292,10 @@ public class OracleAdapter extends JdbcA
      */
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new OracleQualifierTranslator(queryAssembler);
+        QualifierTranslator translator = new Oracle8QualifierTranslator(queryAssembler);
+        translator.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java Wed Sep 14 16:41:03 2011
@@ -30,10 +30,12 @@ import org.apache.cayenne.access.trans.Q
 import org.apache.cayenne.access.trans.QueryAssembler;
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.merge.MergerFactory;
@@ -57,7 +59,8 @@ import org.apache.cayenne.query.SQLActio
  */
 public class PostgresAdapter extends JdbcAdapter {
 
-    public PostgresAdapter() {
+    public PostgresAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
         setSupportsBatchUpdates(true);
     }
 
@@ -255,7 +258,10 @@ public class PostgresAdapter extends Jdb
      */
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new PostgresQualifierTranslator(queryAssembler);
+        QualifierTranslator translator = new PostgresQualifierTranslator(queryAssembler);
+        translator.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java Wed Sep 14 16:41:03 2011
@@ -24,7 +24,9 @@ import java.util.GregorianCalendar;
 
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
@@ -48,7 +50,8 @@ import org.apache.cayenne.query.SQLActio
 // check http://cwiki.apache.org/CAY/sqliteadapter.html for current limitations.
 public class SQLiteAdapter extends JdbcAdapter {
 
-    public SQLiteAdapter() {
+    public SQLiteAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
         this.setSupportsUniqueConstraints(false);
         this.setSupportsGeneratedKeys(true);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java Wed Sep 14 16:41:03 2011
@@ -22,7 +22,9 @@ package org.apache.cayenne.dba.sqlserver
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.sybase.SybaseAdapter;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.merge.MergerFactory;
 import org.apache.cayenne.query.Query;
@@ -77,7 +79,9 @@ public class SQLServerAdapter extends Sy
 
     public static final String TRIM_FUNCTION = "RTRIM";
 
-    public SQLServerAdapter() {
+    public SQLServerAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+        
         // TODO: i wonder if Sybase supports generated keys... 
         // in this case we need to move this to the super.
         this.setSupportsGeneratedKeys(true);
@@ -102,9 +106,12 @@ public class SQLServerAdapter extends Sy
      */
     @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
-        return new SQLServerTrimmingQualifierTranslator(
+        QualifierTranslator translator = new SQLServerTrimmingQualifierTranslator(
                 queryAssembler,
                 SQLServerAdapter.TRIM_FUNCTION);
+        translator.setCaseInsensitive(
+                runtimeProperties.getBoolean(CI_PROPERTY, false));
+        return translator;
     }
 
     

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java Wed Sep 14 16:41:03 2011
@@ -29,8 +29,10 @@ import org.apache.cayenne.access.types.B
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
 import org.apache.cayenne.access.types.ShortType;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.PkGenerator;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.merge.MergerFactory;
 
 /**
@@ -40,6 +42,10 @@ public class SybaseAdapter extends JdbcA
 
     final static String MYSQL_QUOTE_SQL_IDENTIFIERS_CHAR_START = "[";
     final static String MYSQL_QUOTE_SQL_IDENTIFIERS_CHAR_END = "]";
+    
+    public SybaseAdapter(@Inject RuntimeProperties runtimeProperties) {
+        super(runtimeProperties);
+    }
 
     /**
      * @since 3.0

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java Wed Sep 14 16:41:03 2011
@@ -31,6 +31,7 @@ import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.Persistent;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.dba.PkGenerator;
@@ -57,6 +58,9 @@ public class DataContextExtrasTest exten
 
     @Inject
     protected JdbcEventLogger logger;
+    
+    @Inject
+    protected RuntimeProperties runtimeProperties;
 
     protected TableHelper tArtist;
     protected TableHelper tPainting;
@@ -234,7 +238,7 @@ public class DataContextExtrasTest exten
 
         // setup mockup PK generator that will blow on PK request
         // to emulate an exception
-        PkGenerator newGenerator = new JdbcPkGenerator(new JdbcAdapter()) {
+        PkGenerator newGenerator = new JdbcPkGenerator(new JdbcAdapter(runtimeProperties)) {
 
             @Override
             public Object generatePk(DataNode node, DbAttribute pk) throws Exception {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeTest.java Wed Sep 14 16:41:03 2011
@@ -22,8 +22,16 @@ package org.apache.cayenne.access;
 import junit.framework.TestCase;
 
 import org.apache.cayenne.dba.JdbcAdapter;
-
-public class DataNodeTest extends TestCase {
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class DataNodeTest extends ServerCase {
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testName() throws Exception {
         String tstName = "tst_name";
@@ -63,12 +71,16 @@ public class DataNodeTest extends TestCa
 
         assertNull(node.getAdapter());
 
-        JdbcAdapter a1 = new JdbcAdapter();
+        JdbcAdapter a1 = objectFactory.newInstance(
+                JdbcAdapter.class, 
+                JdbcAdapter.class.getName());
         node.setAdapter(a1);
 
         assertSame(a1, node.getAdapter());
 
-        JdbcAdapter a2 = new JdbcAdapter();
+        JdbcAdapter a2 = objectFactory.newInstance(
+                JdbcAdapter.class, 
+                JdbcAdapter.class.getName());
         node.setAdapter(a2);
 
         assertSame(a2, node.getAdapter());

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java Wed Sep 14 16:41:03 2011
@@ -31,6 +31,7 @@ import org.apache.cayenne.access.Optimis
 import org.apache.cayenne.access.trans.DeleteBatchQueryBuilder;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.map.DbAttribute;
@@ -53,6 +54,9 @@ public class BatchActionLockingTest exte
     @Inject
     private Injector injector;
     
+    @Inject
+    private AdhocObjectFactory objectFactory;
+    
     public void testRunAsIndividualQueriesSuccess() throws Exception {
         EntityResolver resolver = runtime.getDataDomain().getEntityResolver();
 
@@ -154,7 +158,7 @@ public class BatchActionLockingTest exte
     }
 
     JdbcAdapter buildAdapter(boolean supportGeneratedKeys) {
-        JdbcAdapter adapter = new JdbcAdapter();
+        JdbcAdapter adapter = objectFactory.newInstance(JdbcAdapter.class, JdbcAdapter.class.getName());
         adapter.setSupportsGeneratedKeys(supportGeneratedKeys);
         injector.injectMembers(adapter);
         return adapter;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionTest.java Wed Sep 14 16:41:03 2011
@@ -21,6 +21,7 @@ package org.apache.cayenne.access.jdbc;
 
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.InsertBatchQuery;
@@ -34,6 +35,9 @@ public class BatchActionTest extends Ser
 
     @Inject
     private ServerRuntime runtime;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testHasGeneratedKeys1() throws Exception {
         EntityResolver resolver = runtime.getChannel().getEntityResolver();
@@ -66,7 +70,9 @@ public class BatchActionTest extends Ser
     }
 
     JdbcAdapter buildAdapter(boolean supportGeneratedKeys) {
-        JdbcAdapter adapter = new JdbcAdapter();
+        JdbcAdapter adapter = objectFactory.newInstance(
+                JdbcAdapter.class, 
+                JdbcAdapter.class.getName());
         adapter.setSupportsGeneratedKeys(supportGeneratedKeys);
         return adapter;
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilderTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilderTest.java Wed Sep 14 16:41:03 2011
@@ -28,6 +28,7 @@ import org.apache.cayenne.PersistenceSta
 import org.apache.cayenne.access.trans.DeleteBatchQueryBuilder;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.map.DbAttribute;
@@ -48,9 +49,13 @@ public class SoftDeleteBatchQueryBuilder
 
     @Inject
     protected DbAdapter adapter;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     private DeleteBatchQueryBuilder createBuilder() {
-        return createBuilder(new JdbcAdapter());
+        return createBuilder(
+                objectFactory.newInstance(JdbcAdapter.class, JdbcAdapter.class.getName()));
     }
 
     private DeleteBatchQueryBuilder createBuilder(JdbcAdapter adapter) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java Wed Sep 14 16:41:03 2011
@@ -26,16 +26,24 @@ import junit.framework.TestCase;
 
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.query.BatchQuery;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-/**
- */
-public class BatchQueryBuilderTest extends TestCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class BatchQueryBuilderTest extends ServerCase {
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
 	public void testConstructor() throws Exception {
-		DbAdapter adapter = new JdbcAdapter();
+		DbAdapter adapter = objectFactory.newInstance(
+		        DbAdapter.class, 
+		        JdbcAdapter.class.getName());
 		BatchQueryBuilder builder =
 			new BatchQueryBuilder(adapter) {
 			@Override
@@ -48,7 +56,9 @@ public class BatchQueryBuilderTest exten
 	}
 
 	public void testAppendDbAttribute1() throws Exception {
-		DbAdapter adapter = new JdbcAdapter();
+	    DbAdapter adapter = objectFactory.newInstance(
+                DbAdapter.class, 
+                JdbcAdapter.class.getName());
 		String trimFunction = "testTrim";
 
 		BatchQueryBuilder builder =
@@ -76,7 +86,9 @@ public class BatchQueryBuilderTest exten
 	}
 
 	public void testAppendDbAttribute2() throws Exception {
-		DbAdapter adapter = new JdbcAdapter();
+	    DbAdapter adapter = objectFactory.newInstance(
+                DbAdapter.class, 
+                JdbcAdapter.class.getName());
 
 		BatchQueryBuilder builder = new BatchQueryBuilder(adapter) {
 			@Override

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java Wed Sep 14 16:41:03 2011
@@ -27,6 +27,7 @@ import java.util.List;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
@@ -43,9 +44,14 @@ public class DeleteBatchQueryBuilderTest
 
     @Inject
     private DbAdapter adapter;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testConstructor() throws Exception {
-        DbAdapter adapter = new JdbcAdapter();
+        DbAdapter adapter = objectFactory.newInstance(
+                DbAdapter.class, 
+                JdbcAdapter.class.getName());
 
         DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(adapter);
 
@@ -60,7 +66,8 @@ public class DeleteBatchQueryBuilderTest
                 .getAttribute("LOCKING_TEST_ID"));
 
         DeleteBatchQuery deleteQuery = new DeleteBatchQuery(entity, idAttributes, null, 1);
-        DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(new JdbcAdapter());
+        DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(
+                objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName()));
         String generatedSql = builder.createSqlString(deleteQuery);
         assertNotNull(generatedSql);
         assertEquals(
@@ -83,7 +90,8 @@ public class DeleteBatchQueryBuilderTest
                 idAttributes,
                 nullAttributes,
                 1);
-        DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(new JdbcAdapter());
+        DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(
+                objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName()));
         String generatedSql = builder.createSqlString(deleteQuery);
         assertNotNull(generatedSql);
         assertEquals("DELETE FROM "

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java Wed Sep 14 16:41:03 2011
@@ -21,6 +21,7 @@ package org.apache.cayenne.access.trans;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.query.InsertBatchQuery;
@@ -36,9 +37,14 @@ public class InsertBatchQueryBuilderTest
 
     @Inject
     private DbAdapter adapter;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testConstructor() throws Exception {
-        DbAdapter adapter = new JdbcAdapter();
+        DbAdapter adapter = objectFactory.newInstance(
+                DbAdapter.class, 
+                JdbcAdapter.class.getName());
 
         DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(adapter);
 
@@ -50,7 +56,8 @@ public class InsertBatchQueryBuilderTest
                 SimpleLockingTestEntity.class).getDbEntity();
 
         InsertBatchQuery deleteQuery = new InsertBatchQuery(entity, 1);
-        InsertBatchQueryBuilder builder = new InsertBatchQueryBuilder(new JdbcAdapter());
+        InsertBatchQueryBuilder builder = new InsertBatchQueryBuilder(
+                objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName()));
         String generatedSql = builder.createSqlString(deleteQuery);
         assertNotNull(generatedSql);
         assertEquals("INSERT INTO "

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java Wed Sep 14 16:41:03 2011
@@ -27,6 +27,7 @@ import java.util.List;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.query.UpdateBatchQuery;
@@ -42,9 +43,14 @@ public class UpdateBatchQueryBuilderTest
 
     @Inject
     private DbAdapter adapter;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testConstructor() throws Exception {
-        DbAdapter adapter = new JdbcAdapter();
+        DbAdapter adapter = objectFactory.newInstance(
+                DbAdapter.class, 
+                JdbcAdapter.class.getName());
         UpdateBatchQueryBuilder builder = new UpdateBatchQueryBuilder(adapter);
         assertSame(adapter, builder.getAdapter());
     }
@@ -64,7 +70,8 @@ public class UpdateBatchQueryBuilderTest
                 updatedAttributes,
                 null,
                 1);
-        UpdateBatchQueryBuilder builder = new UpdateBatchQueryBuilder(new JdbcAdapter());
+        UpdateBatchQueryBuilder builder = new UpdateBatchQueryBuilder(
+                objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName()));
         String generatedSql = builder.createSqlString(updateQuery);
         assertNotNull(generatedSql);
         assertEquals("UPDATE "
@@ -90,7 +97,8 @@ public class UpdateBatchQueryBuilderTest
                 updatedAttributes,
                 nullAttributes,
                 1);
-        UpdateBatchQueryBuilder builder = new UpdateBatchQueryBuilder(new JdbcAdapter());
+        UpdateBatchQueryBuilder builder = new UpdateBatchQueryBuilder(
+                objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName()));
         String generatedSql = builder.createSqlString(updateQuery);
         assertNotNull(generatedSql);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java Wed Sep 14 16:41:03 2011
@@ -34,6 +34,8 @@ import org.apache.cayenne.access.DataNod
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.ThrowOnPartialOrCreateSchemaStrategy;
+import org.apache.cayenne.access.jdbc.BatchQueryBuilderFactory;
+import org.apache.cayenne.access.jdbc.DefaultBatchQueryBuilderFactory;
 import org.apache.cayenne.ashwood.AshwoodEntitySorter;
 import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.configuration.ConfigurationNameMapper;
@@ -44,9 +46,24 @@ import org.apache.cayenne.configuration.
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.configuration.DefaultConfigurationNameMapper;
 import org.apache.cayenne.configuration.DefaultDataChannelDescriptorMerger;
+import org.apache.cayenne.configuration.DefaultRuntimeProperties;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.configuration.mock.MockDataSourceFactory;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.db2.DB2Sniffer;
+import org.apache.cayenne.dba.derby.DerbySniffer;
+import org.apache.cayenne.dba.frontbase.FrontBaseSniffer;
+import org.apache.cayenne.dba.h2.H2Sniffer;
+import org.apache.cayenne.dba.hsqldb.HSQLDBSniffer;
+import org.apache.cayenne.dba.ingres.IngresSniffer;
+import org.apache.cayenne.dba.mysql.MySQLSniffer;
+import org.apache.cayenne.dba.openbase.OpenBaseSniffer;
 import org.apache.cayenne.dba.oracle.OracleAdapter;
+import org.apache.cayenne.dba.oracle.OracleSniffer;
+import org.apache.cayenne.dba.postgres.PostgresSniffer;
+import org.apache.cayenne.dba.sqlite.SQLiteSniffer;
+import org.apache.cayenne.dba.sqlserver.SQLServerSniffer;
+import org.apache.cayenne.dba.sybase.SybaseSniffer;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
@@ -117,6 +134,26 @@ public class DataDomainProviderTest exte
         Module testModule = new Module() {
 
             public void configure(Binder binder) {
+                final AdhocObjectFactory objectFactory = new DefaultAdhocObjectFactory();
+                binder.bind(AdhocObjectFactory.class).toInstance(objectFactory);
+                
+                binder.bindMap(DefaultRuntimeProperties.PROPERTIES_MAP);
+                
+                binder
+                        .bindList(DefaultDbAdapterFactory.DETECTORS_LIST)
+                        .add(new OpenBaseSniffer(objectFactory))
+                        .add(new FrontBaseSniffer(objectFactory))
+                        .add(new IngresSniffer(objectFactory))
+                        .add(new SQLiteSniffer(objectFactory))
+                        .add(new DB2Sniffer(objectFactory))
+                        .add(new H2Sniffer(objectFactory))
+                        .add(new HSQLDBSniffer(objectFactory))
+                        .add(new SybaseSniffer(objectFactory))
+                        .add(new DerbySniffer(objectFactory))
+                        .add(new SQLServerSniffer(objectFactory))
+                        .add(new OracleSniffer(objectFactory))
+                        .add(new PostgresSniffer(objectFactory))
+                        .add(new MySQLSniffer(objectFactory));
                 binder.bindList(DataDomainProvider.FILTERS_LIST);
                 binder.bindList(DataDomainProvider.LOCATIONS_LIST).add(testConfigName);
                 binder.bind(EventManager.class).toInstance(eventManager);
@@ -129,20 +166,10 @@ public class DataDomainProviderTest exte
                 binder.bind(DataChannelDescriptorLoader.class).toInstance(testLoader);
                 binder.bind(SchemaUpdateStrategy.class).toInstance(
                         new SkipSchemaUpdateStrategy());
-                binder.bind(DbAdapterFactory.class).toInstance(new DbAdapterFactory() {
-
-                    public DbAdapter createAdapter(
-                            DataNodeDescriptor nodeDescriptor,
-                            DataSource dataSource) throws Exception {
-
-                        if (nodeDescriptor.getAdapterType() != null) {
-                            return (DbAdapter) Class.forName(
-                                    nodeDescriptor.getAdapterType()).newInstance();
-                        }
-
-                        return mockAdapter;
-                    }
-                });
+                binder.bind(DbAdapterFactory.class).to(DefaultDbAdapterFactory.class);
+                binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class);
+                binder.bind(BatchQueryBuilderFactory.class).to(
+                        DefaultBatchQueryBuilderFactory.class);
 
                 binder.bind(DataSourceFactory.class).toInstance(
                         new MockDataSourceFactory());
@@ -208,6 +235,5 @@ public class DataDomainProviderTest exte
                 .getName());
 
         assertNotNull(node2.getAdapter());
-        assertSame(mockAdapter, node2.getAdapter());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java Wed Sep 14 16:41:03 2011
@@ -31,6 +31,8 @@ import junit.framework.TestCase;
 
 import org.apache.cayenne.access.jdbc.BatchQueryBuilderFactory;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DefaultRuntimeProperties;
+import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.dba.AutoAdapter;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.sybase.SybaseAdapter;
@@ -94,8 +96,10 @@ public class DefaultDbAdapterFactoryTest
         Module testModule = new Module() {
 
             public void configure(Binder binder) {
+                binder.bindMap(DefaultRuntimeProperties.PROPERTIES_MAP);
                 binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
                 binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+                binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class);
                 binder.bind(BatchQueryBuilderFactory.class).toInstance(
                         mock(BatchQueryBuilderFactory.class));
             }
@@ -127,8 +131,10 @@ public class DefaultDbAdapterFactoryTest
         Module testModule = new Module() {
 
             public void configure(Binder binder) {
+                binder.bindMap(DefaultRuntimeProperties.PROPERTIES_MAP);
                 binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
                 binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+                binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class);
                 binder.bind(BatchQueryBuilderFactory.class).toInstance(
                         mock(BatchQueryBuilderFactory.class));
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/JdbcAdapterTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/JdbcAdapterTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/JdbcAdapterTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/JdbcAdapterTest.java Wed Sep 14 16:41:03 2011
@@ -22,6 +22,7 @@ package org.apache.cayenne.dba;
 import java.sql.Types;
 
 import org.apache.cayenne.dba.mysql.MySQLAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbAttribute;
@@ -35,6 +36,9 @@ public class JdbcAdapterTest extends Ser
 
     @Inject
     private DbAdapter dbAdapter;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testExternalTypesForJdbcType() throws Exception {
         // check a few types
@@ -45,7 +49,9 @@ public class JdbcAdapterTest extends Ser
     }
 
     private void checkType(int type) throws java.lang.Exception {
-        JdbcAdapter adapter = new JdbcAdapter();
+        JdbcAdapter adapter = objectFactory.newInstance(
+                JdbcAdapter.class, 
+                JdbcAdapter.class.getName());
 
         String[] types = adapter.externalTypesForJdbcType(type);
         assertNotNull(types);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterTest.java Wed Sep 14 16:41:03 2011
@@ -21,15 +21,23 @@ package org.apache.cayenne.dba.hsqldb;
 
 import java.sql.Types;
 
-import junit.framework.TestCase;
-
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-public class HSQLDBAdapterTest extends TestCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class HSQLDBAdapterTest extends ServerCase {
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testCreateTableIgnoresDoublePrecision() {
-        HSQLDBAdapter adapter = new HSQLDBAdapter();
+        HSQLDBAdapter adapter = objectFactory.newInstance(
+                HSQLDBAdapter.class, 
+                HSQLDBAdapter.class.getName());
         DbEntity e = new DbEntity("Test");
         DbAttribute dblPrec = new DbAttribute("dbl1");
         dblPrec.setType(Types.DOUBLE);
@@ -45,7 +53,9 @@ public class HSQLDBAdapterTest extends T
     }
     
     public void testCreateTableAddsCachedKeyword() {
-        HSQLDBAdapter adapter = new HSQLDBAdapter();
+        HSQLDBAdapter adapter = objectFactory.newInstance(
+                HSQLDBAdapter.class, 
+                HSQLDBAdapter.class.getName());
         DbEntity e = new DbEntity("Test");
         DbAttribute dblPrec = new DbAttribute("dbl1");
         dblPrec.setType(Types.INTEGER);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterTest.java Wed Sep 14 16:41:03 2011
@@ -19,15 +19,23 @@
 
 package org.apache.cayenne.dba.mysql;
 
-import junit.framework.TestCase;
-
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-public class MySQLAdapterTest extends TestCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class MySQLAdapterTest extends ServerCase {
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testCreateTableAppendPKClause() {
-        MySQLAdapter adapter = new MySQLAdapter();
+        MySQLAdapter adapter = objectFactory.newInstance(
+                MySQLAdapter.class, 
+                MySQLAdapter.class.getName());
 
         DbEntity e = new DbEntity("Test");
         DbAttribute pk1 = new DbAttribute("PK1");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterTest.java Wed Sep 14 16:41:03 2011
@@ -22,21 +22,36 @@ package org.apache.cayenne.dba.oracle;
 import java.net.URL;
 import java.sql.Types;
 
-import junit.framework.TestCase;
-
-public class Oracle8AdapterTest extends TestCase {
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class Oracle8AdapterTest extends ServerCase {
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testTimestampMapping() throws Exception {
+        
+        Oracle8Adapter adapter = objectFactory.newInstance(
+                Oracle8Adapter.class, 
+                Oracle8Adapter.class.getName());
 
-        String[] types = new Oracle8Adapter().externalTypesForJdbcType(Types.TIMESTAMP);
+        String[] types = adapter.externalTypesForJdbcType(Types.TIMESTAMP);
         assertNotNull(types);
         assertEquals(1, types.length);
         assertEquals("DATE", types[0]);
     }
 
     public void testFindAdapterResource() throws Exception {
+        
+        Oracle8Adapter adapter = objectFactory.newInstance(
+                Oracle8Adapter.class, 
+                Oracle8Adapter.class.getName());
 
-        URL typesURL = new Oracle8Adapter().findResource("/types.xml");
+        URL typesURL = adapter.findResource("/types.xml");
         assertNotNull(typesURL);
         assertTrue("Unexpected url:" + typesURL, typesURL.toExternalForm().endsWith(
                 "types-oracle8.xml"));

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterTest.java Wed Sep 14 16:41:03 2011
@@ -22,6 +22,7 @@ package org.apache.cayenne.dba.oracle;
 import java.sql.Types;
 
 import org.apache.cayenne.configuration.server.ServerRuntime;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.query.InsertBatchQuery;
@@ -33,6 +34,9 @@ public class OracleAdapterTest extends S
 
     @Inject
     private ServerRuntime runtime;
+    
+    @Inject
+    private AdhocObjectFactory objectFactory;
 
     public void testUpdatesLOBColumns() throws Exception {
         DataMap map = runtime.getDataDomain().getDataMap("testmap");
@@ -45,8 +49,12 @@ public class OracleAdapterTest extends S
     }
 
     public void testTimestampMapping() throws Exception {
+        
+        OracleAdapter adapter = objectFactory.newInstance(
+                OracleAdapter.class, 
+                OracleAdapter.class.getName());
 
-        String[] types = new OracleAdapter().externalTypesForJdbcType(Types.TIMESTAMP);
+        String[] types = adapter.externalTypesForJdbcType(Types.TIMESTAMP);
         assertNotNull(types);
         assertEquals(1, types.length);
         assertEquals("TIMESTAMP", types[0]);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorTest.java?rev=1170706&r1=1170705&r2=1170706&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorTest.java Wed Sep 14 16:41:03 2011
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.dba.oracle;
 
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbEntity;
@@ -31,12 +32,16 @@ public class OraclePkGeneratorTest exten
     
     @Inject
     protected JdbcEventLogger logger;
+    
+    @Inject
+    protected AdhocObjectFactory objectFactory;
 
     private OraclePkGenerator pkGenerator;
 
     @Override
     protected void setUpAfterInjection() throws Exception {
-        pkGenerator = new OraclePkGenerator(new OracleAdapter());
+        pkGenerator = new OraclePkGenerator(
+                objectFactory.newInstance(OracleAdapter.class, OracleAdapter.class.getName()));
     }
 
     public void testSequenceNameDefault() throws Exception {



Mime
View raw message