cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject cayenne git commit: CAY-1902 Implement resolving Db paths for DataObjects
Date Sat, 23 May 2015 12:44:33 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 19d42daba -> 0aad4a810


CAY-1902 Implement resolving Db paths for DataObjects

* using modern API to get data


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/0aad4a81
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/0aad4a81
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/0aad4a81

Branch: refs/heads/master
Commit: 0aad4a810669d12e744106a4f2858af10dd97259
Parents: 19d42da
Author: aadamchik <aadamchik@apache.org>
Authored: Sat May 23 15:01:36 2015 +0300
Committer: aadamchik <aadamchik@apache.org>
Committed: Sat May 23 15:44:12 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/cayenne/exp/parser/ASTDbPath.java   | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/0aad4a81/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTDbPath.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTDbPath.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTDbPath.java
index 7de3d75..4e1d3c9 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTDbPath.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTDbPath.java
@@ -26,7 +26,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cayenne.Cayenne;
-import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.Persistent;
@@ -36,8 +35,8 @@ import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
 import org.apache.cayenne.map.Entity;
+import org.apache.cayenne.query.ObjectSelect;
 import org.apache.cayenne.query.SelectById;
-import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.util.CayenneMapEntry;
 
 /**
@@ -130,13 +129,8 @@ public class ASTDbPath extends ASTPath {
 			}
 		}
 
-		SelectQuery<DataRow> query = new SelectQuery<DataRow>(finalEntity, ExpressionFactory.matchDbExp(
-				reversedPathStr.toString(), persistent));
-
-		// TODO: DbEntity root option for ObjectSelect?
-		query.setFetchingDataRows(true);
-		DataRow result = persistent.getObjectContext().selectOne(query);
-		return result;
+		return ObjectSelect.dbQuery(finalEntity.getName())
+				.where(ExpressionFactory.matchDbExp(reversedPathStr.toString(), persistent)).selectOne(context);
 	}
 
 	private Map<?, ?> toMap_AttchedObject_SingleStepPath(ObjectContext context, Persistent
persistent) {


Mime
View raw message