cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r682206 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/
Date Sun, 03 Aug 2008 20:28:47 GMT
Author: aadamchik
Date: Sun Aug  3 13:28:47 2008
New Revision: 682206

URL: http://svn.apache.org/viewvc?rev=682206&view=rev
Log:
CAY-1070 Generating SelectQuery Access Code (patch 2)

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapArtifact.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapUtils.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=682206&r1=682205&r2=682206&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sun Aug  3 13:28:47 2008
@@ -25,6 +25,7 @@
 CAY-1060 CM: Allow multiple item selections
 CAY-1061 ResourceFinder: abstract API for looking up resources, including multiple resources
for a given name
 CAY-1068 Add support for start index/offset of queries
+CAY-1070 Generating SelectQuery Access Code
 CAY-1085 Use standard JDBC API for writing Oracle LOBs
 
 Bug fixes since M4:

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapArtifact.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapArtifact.java?rev=682206&r1=682205&r2=682206&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapArtifact.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapArtifact.java
Sun Aug  3 13:28:47 2008
@@ -58,7 +58,9 @@
     }
 
     public String getQualifiedClassName() {
-        return dataMap.getDefaultPackage() + '.' + NameConverter.specialCharsToJava(dataMap.getName());
+        return dataMap.getDefaultPackage() + '.' + 
+                NameConverter.underscoredToJava(
+                  NameConverter.specialCharsToJava(dataMap.getName()), true);
     }
 
     public Object getObject() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapUtils.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapUtils.java?rev=682206&r1=682205&r2=682206&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapUtils.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/gen/DataMapUtils.java
Sun Aug  3 13:28:47 2008
@@ -31,6 +31,7 @@
 import org.apache.cayenne.query.QualifiedQuery;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.util.NameConverter;
+import org.apache.commons.collections.set.ListOrderedSet;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -38,6 +39,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Collections;
+import java.util.Set;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 
@@ -59,7 +61,7 @@
      * @return Method name that perform query.
      */
     public String getQueryMethodName(Query query) {
-        return NameConverter.specialCharsToJava(query.getName());
+        return NameConverter.underscoredToJava(query.getName(), true);
     }
 
     /**
@@ -68,7 +70,7 @@
      * @param query
      * @return Parameter names.
      */
-    public Collection<String> getParameterNames(QualifiedQuery query) {
+    public Collection getParameterNames(QualifiedQuery query) {
         Map<String, String> queryParameters = queriesMap.get(query.getName());
 
         if ( queryParameters == null) {
@@ -85,13 +87,13 @@
      * @param qualifierString to be parsed
      * @return List of parameter names.
      */
-    private List<String> parseQualifier(String qualifierString) {
-        List<String> result = new LinkedList<String>();
+    private Set parseQualifier(String qualifierString) {
+        Set result = new ListOrderedSet();
         Pattern pattern = Pattern.compile("\\$[\\w]+");
         Matcher matcher = pattern.matcher(qualifierString);
         while(matcher.find()) {
             String name = matcher.group();
-            result.add(name.substring(1));
+            result.add(NameConverter.underscoredToJava(name.substring(1), false));
         }
         
         return result;
@@ -163,7 +165,7 @@
             }
 
             for (String name : names) {
-                types.put(name, typeName);
+                types.put(NameConverter.underscoredToJava(name, false), typeName);
             }
 
             return types;



Mime
View raw message