@@ -47,7 +47,8 @@ public String buildQuery(DeleteQuery query, Map<String, Object> parameters) {
4747 if (!columns .isEmpty ()) {
4848 cypher .append (" SET " );
4949 cypher .append (columns .stream ()
50- .map (col -> "e." + translateField (col ) + " = NULL" )
50+ .map (this ::translateField )
51+ .map (col -> col + " = NULL" )
5152 .collect (Collectors .joining (", " )));
5253 } else {
5354 cypher .append (" DELETE e" );
@@ -95,7 +96,7 @@ public String buildQuery(SelectQuery query, Map<String, Object> parameters) {
9596 private void createWhereClause (StringBuilder cypher , CriteriaCondition condition , Map <String , Object > parameters ) {
9697 Element element = condition .element ();
9798 String fieldName = element .name ();
98- String queryField = translateField (fieldName ); // Correct field translation
99+ String queryField = translateField (fieldName );
99100
100101 switch (condition .condition ()) {
101102 case EQUALS :
@@ -134,9 +135,16 @@ private void createWhereClause(StringBuilder cypher, CriteriaCondition condition
134135 }
135136
136137 private String translateField (String field ) {
137- return INTERNAL_ID .equals (field ) ? "elementId(e)" : "e." + field ;
138+ if (INTERNAL_ID .equals (field )) {
139+ return "elementId(e)" ;
140+ }
141+ if (field .startsWith ("e." )) {
142+ return field ;
143+ }
144+ return "e." + field ;
138145 }
139146
147+
140148 private String getConditionOperator (Condition condition ) {
141149 return switch (condition ) {
142150 case EQUALS -> "=" ;
0 commit comments