cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r745553 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/access/trans/TrimmingQualifierTranslator.java test/java/org/apache/cayenne/access/DbLoaderTest.java
Date Wed, 18 Feb 2009 16:08:23 GMT
Author: aadamchik
Date: Wed Feb 18 16:08:22 2009
New Revision: 745553

URL: http://svn.apache.org/viewvc?rev=745553&view=rev
Log:
CAY-289  Implement Quoting of identifiers

patch by Olga Tkachova - fixing quoting in trimming qualifiers

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/TrimmingQualifierTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/TrimmingQualifierTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/TrimmingQualifierTranslator.java?rev=745553&r1=745552&r2=745553&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/TrimmingQualifierTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/TrimmingQualifierTranslator.java
Wed Feb 18 16:08:22 2009
@@ -55,6 +55,22 @@
             super.processColumn(dbAttr);
         }
     }
+    
+    /**
+     * Adds special handling of CHAR columns.
+     */
+    @Override
+    protected void processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr) throws IOException
{
+        
+        if (dbAttr.getType() == Types.CHAR) {
+            out.append(trimFunction).append("(");
+            super.processColumnWithQuoteSqlIdentifiers(dbAttr);
+            out.append(')');
+        }
+        else {
+            super.processColumnWithQuoteSqlIdentifiers(dbAttr);
+        }                 
+    }
 
     /**
      * Returns the trimFunction.

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderTest.java?rev=745553&r1=745552&r2=745553&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderTest.java
Wed Feb 18 16:08:22 2009
@@ -102,13 +102,25 @@
             String tableLabel = getNode().getAdapter().tableTypeForTable();
 
             loader.setCreatingMeaningfulPK(true);
-            loader.loadDbEntities(map, loader.getTables(
+            
+            List<DbEntity> testLoader = loader.getTables(
                     null,
                     null,
-                    "ARTIST",
+                    "artist",
                     new String[] {
                         tableLabel
-                    }));
+                    });
+            if(testLoader.size()==0){
+                testLoader = loader.getTables(
+                        null,
+                        null,
+                        "ARTIST",
+                        new String[] {
+                            tableLabel
+                        });
+            }
+            
+            loader.loadDbEntities(map, testLoader);
 
             loader.loadObjEntities(map);
             ObjEntity artist = map.getObjEntity("Artist");



Mime
View raw message