You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by nt...@apache.org on 2020/04/06 17:13:47 UTC
[cayenne] 01/03: Bugfix: No methods for queries with qualifier
parameters generated.
This is an automated email from the ASF dual-hosted git repository.
ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 05ec056740646fdee69d15b3fc8c1e665794f9fd
Author: Ralf Schuchardt <ra...@gmx.de>
AuthorDate: Sat Apr 4 20:26:06 2020 +0200
Bugfix: No methods for queries with qualifier parameters generated.
Cgen should generate a perform-method for queries with qualifiers (e.g. "username = $ausername") stored in the datamap, but there is no method generated. Queries without qualifiers get a method.
If the alias map for Entity.lastPathComponent is null then an exception is thrown later in org.apache.cayenne.map.PathComponentIterator at the line "this.aliasMap = Objects.requireNonNull(aliasMap)". This means the qualifier is seen as invalid and therefore no perform-method is generated.
---
cayenne-cgen/src/main/java/org/apache/cayenne/gen/DataMapUtils.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/DataMapUtils.java b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/DataMapUtils.java
index 8a8c41d..57b0ba3 100644
--- a/cayenne-cgen/src/main/java/org/apache/cayenne/gen/DataMapUtils.java
+++ b/cayenne-cgen/src/main/java/org/apache/cayenne/gen/DataMapUtils.java
@@ -179,7 +179,7 @@ public class DataMapUtils {
if (operand instanceof ASTObjPath) {
PathComponent<ObjAttribute, ObjRelationship> component = ((Entity) root).lastPathComponent(
- (ASTObjPath) operand, null);
+ (ASTObjPath) operand, Collections.emptyMap());
ObjAttribute attribute = component.getAttribute();
if (attribute != null) {
typeName = attribute.getType();