Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
e873c5b7
Verified
Commit
e873c5b7
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: change behavior of FIND *
parent
9e35ead5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!96
DOC: Added CITATION.cff to the list of files in the release guide where the...
,
!71
F find query
Pipeline
#30362
failed
2 years ago
Stage: info
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
src/main/java/org/caosdb/server/query/Query.java
+7
-10
7 additions, 10 deletions
src/main/java/org/caosdb/server/query/Query.java
with
9 additions
and
10 deletions
CHANGELOG.md
+
2
−
0
View file @
e873c5b7
...
...
@@ -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`
.
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/caosdb/server/query/Query.java
+
7
−
10
View file @
e873c5b7
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment