Skip to content
Snippets Groups Projects
Verified Commit e873c5b7 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

ENH: change behavior of FIND *

parent 9e35ead5
No related branches found
No related tags found
2 merge requests!96DOC: Added CITATION.cff to the list of files in the release guide where the...,!71F find query
Pipeline #30362 failed
......@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
server property.
* The new `FIND_QUERY_DEFAULT_ROLE` server property defaults to `RECORD`
which is why the behavior of the server api has a **breaking change**.
* The semantics of `FIND *` are affected as well. `FIND *` is equivalent to
`FIND <FIND_QUERY_DEFAULT_ROLE>`.
* Of course, administrators can choose to retain the old behavior by setting
`FIND_QUERY_DEFAULT_ROLE=ENTITY`.
......
......@@ -596,16 +596,6 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
* </ol>
*/
public void optimize() {
// basic optimization
if (this.entity != null
&& this.entity.type == Pattern.TYPE_LIKE
&& this.entity.str.equals("*")) {
this.entity = null;
if (this.role == null) {
this.role = Role.ENTITY;
}
}
// "FIND Person" is interpreted as "FIND RECORD Person"
if (this.role == null) {
try {
......@@ -621,6 +611,13 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
throw new UnsupportedOperationException(e);
}
}
// "FIND *" is interpreted as "FIND RECORD", "FIND <ROLE> *" as "FIND <ROLE>"
if (this.entity != null
&& this.entity.type == Pattern.TYPE_LIKE
&& this.entity.str.equals("*")) {
this.entity = null;
}
}
private String executeStrategy(final boolean versioned) throws QueryException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment