cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r653209 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/access/trans/ main/java/org/apache/cayenne/map/ test/java/org/apache/cayenne/access/ test/java/org/apache/cayenne/map/
Date Sun, 04 May 2008 14:00:00 GMT
Author: aadamchik
Date: Sun May  4 06:59:59 2008
New Revision: 653209

URL: http://svn.apache.org/viewvc?rev=653209&view=rev
Log:
CAY-802  Split Expressions
(renaming the new path resolving method name)

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DbEntity.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/Entity.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjRelationship.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextJoinAliasesTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/MockEntity.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssemblerHelper.java
Sun May  4 06:59:59 2008
@@ -92,7 +92,7 @@
         ObjRelationship lastRelationship = null;
 
         for (PathComponent<ObjAttribute, ObjRelationship> component : getObjEntity()
-                .pathComponents(pathExp, queryAssembler.getJoinAliases())) {
+                .resolvePath(pathExp, queryAssembler.getJoinAliases())) {
 
             ObjRelationship relationship = component.getRelationship();
             ObjAttribute attribute = component.getAttribute();
@@ -131,7 +131,7 @@
     protected void appendDbPath(StringBuffer buf, Expression pathExp) {
 
         for (PathComponent<DbAttribute, DbRelationship> component : getDbEntity()
-                .pathComponents(pathExp, queryAssembler.getJoinAliases())) {
+                .resolvePath(pathExp, queryAssembler.getJoinAliases())) {
 
             DbRelationship relationship = component.getRelationship();
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Sun May  4 06:59:59 2008
@@ -354,7 +354,7 @@
 
                 PathComponent<DbAttribute, DbRelationship> lastComponent = null;
                 for (PathComponent<DbAttribute, DbRelationship> component : table
-                        .pathComponents(pathExp, getJoinAliases())) {
+                        .resolvePath(pathExp, getJoinAliases())) {
 
                     // do not add join for the last DB Rel
                     if (component.getRelationship() != null && !component.isLast())
{
@@ -421,7 +421,7 @@
 
                 DbRelationship r = null;
                 for (PathComponent<DbAttribute, DbRelationship> component : table
-                        .pathComponents(dbPrefetch, getJoinAliases())) {
+                        .resolvePath(dbPrefetch, getJoinAliases())) {
                     r = component.getRelationship();
                     dbRelationshipAdded(r, JoinType.INNER);
                 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DbEntity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DbEntity.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DbEntity.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DbEntity.java
Sun May  4 06:59:59 2008
@@ -276,7 +276,7 @@
      */
     @Override
     @SuppressWarnings("unchecked")
-    public Iterable<PathComponent<DbAttribute, DbRelationship>> pathComponents(
+    public Iterable<PathComponent<DbAttribute, DbRelationship>> resolvePath(
             final Expression pathExp,
             final Map aliasMap) {
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/Entity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/Entity.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/Entity.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/Entity.java
Sun May  4 06:59:59 2008
@@ -289,9 +289,10 @@
      * 
      * @since 1.1
      */
+    // TODO: andrus 2008/05/03 - support aliases?
     public Object lastPathComponent(Expression pathExp) {
 
-        for (PathComponent<Attribute, Relationship> component : pathComponents(
+        for (PathComponent<Attribute, Relationship> component : resolvePath(
                 pathExp,
                 Collections.EMPTY_MAP)) {
             if (component.isLast()) {
@@ -305,19 +306,20 @@
     }
 
     /**
-     * Processes expression argument and returns an Iterable over the path components.
-     * Path expression can use aliases. In this case an optional aliasMap parameter will
-     * be consulted to resolve them.
+     * Returns an Iterable over the path components with elements represented as
+     * {@link PathComponent} instances, encapsulating a relationship, an attribute or a
+     * subpath alias. An optional "aliasMap" parameter is used to resolve subpaths from
+     * aliases.
      * <p>
-     * This method is lazy in a sense that if path is invalid and can not be resolved from
-     * this entity, this method will still return an Iterator, but an attempt to read the
-     * first invalid path component will result in ExpressionException.
+     * This method is lazy: if path is invalid and can not be resolved from this entity,
+     * this method will still return an Iterator, but an attempt to read the first invalid
+     * path component will result in ExpressionException.
      * </p>
      * 
      * @since 3.0
      */
     @SuppressWarnings("unchecked")
-    public abstract <T extends Attribute, U extends Relationship> Iterable<PathComponent<T,
U>> pathComponents(
+    public abstract <T extends Attribute, U extends Relationship> Iterable<PathComponent<T,
U>> resolvePath(
             Expression pathExp,
             Map aliasMap);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
Sun May  4 06:59:59 2008
@@ -837,7 +837,7 @@
      */
     @Override
     @SuppressWarnings("unchecked")
-    public Iterable<PathComponent<ObjAttribute, ObjRelationship>> pathComponents(
+    public Iterable<PathComponent<ObjAttribute, ObjRelationship>> resolvePath(
             final Expression pathExp,
             final Map aliasMap) {
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjRelationship.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjRelationship.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjRelationship.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjRelationship.java
Sun May  4 06:59:59 2008
@@ -534,7 +534,7 @@
 
         try {
             for (PathComponent<DbAttribute, DbRelationship> pathComponent : dbEntity
-                    .pathComponents(new ASTDbPath(path), Collections.emptyMap())) {
+                    .resolvePath(new ASTDbPath(path), Collections.emptyMap())) {
 
                 if (validPath.length() > 0) {
                     validPath.append(Entity.PATH_SEPARATOR);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextJoinAliasesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextJoinAliasesTest.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextJoinAliasesTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextJoinAliasesTest.java
Sun May  4 06:59:59 2008
@@ -20,6 +20,7 @@
 
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.art.Artist;
@@ -60,10 +61,10 @@
         query.andQualifier(ExpressionFactory.matchExp("p.toArtist", picasso));
         query.andQualifier(ExpressionFactory.matchExp("d.toArtist", dali));
 
-        // List<Gallery> galleries = context.performQuery(query);
-        //
-        // assertEquals(1, galleries.size());
-        // assertEquals("G1", galleries.get(0).getGalleryName());
+//        List<Gallery> galleries = context.performQuery(query);
+//
+//        assertEquals(1, galleries.size());
+//        assertEquals("G1", galleries.get(0).getGalleryName());
     }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/MockEntity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/MockEntity.java?rev=653209&r1=653208&r2=653209&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/MockEntity.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/map/MockEntity.java
Sun May  4 06:59:59 2008
@@ -52,7 +52,7 @@
     }
     
     @Override
-    public <T extends Attribute, U extends Relationship> Iterable<PathComponent<T,
U>> pathComponents(
+    public <T extends Attribute, U extends Relationship> Iterable<PathComponent<T,
U>> resolvePath(
             Expression pathExp, Map joinAliases) {
         return null;
     }



Mime
View raw message