Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Merge requests
!43
Merge dev to master
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Merge dev to master
dev
into
master
Overview
1
Commits
1130
Pipelines
0
Changes
6
Merged
Merge dev to master
Martin Weise
requested to merge
dev
into
master
Mar 2, 2022
Overview
1
Commits
1130
Pipelines
0
Changes
6
Somebody else has to merge it
Edited
Mar 2, 2022
by
Martin Weise
0
0
Merge request reports
Viewing commit
8145a529
Prev
Next
Show latest version
6 files
+
40
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
8145a529
Started adding pagination
· 8145a529
Moritz Staudinger
authored
Mar 3, 2022
fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java
+
6
−
4
View file @ 8145a529
Edit in single-file editor
Open in Web IDE
Show full file
@@ -52,7 +52,8 @@ public class QueryEndpoint {
@ApiResponse
(
code
=
409
,
message
=
"The container image is not supported."
),})
public
ResponseEntity
<
QueryResultDto
>
execute
(
@NotNull
@PathVariable
(
"id"
)
Long
id
,
@NotNull
@PathVariable
(
"databaseId"
)
Long
databaseId
,
@Valid
@RequestBody
ExecuteStatementDto
data
)
@Valid
@RequestBody
ExecuteStatementDto
data
,
@RequestParam
(
"page"
)
Long
page
,
@RequestParam
(
"size"
)
Long
size
)
throws
DatabaseNotFoundException
,
ImageNotSupportedException
,
QueryStoreException
,
QueryMalformedException
,
TableNotFoundException
,
ContainerNotFoundException
{
/* validation */
@@ -65,7 +66,7 @@ public class QueryEndpoint {
throw
new
QueryMalformedException
(
"Invalid table"
);
}
log
.
debug
(
"Data for execution: {}"
,
data
);
final
QueryResultDto
result
=
queryService
.
execute
(
id
,
databaseId
,
data
);
final
QueryResultDto
result
=
queryService
.
execute
(
id
,
databaseId
,
data
,
page
,
size
);
return
ResponseEntity
.
status
(
HttpStatus
.
ACCEPTED
)
.
body
(
result
);
}
@@ -101,12 +102,13 @@ public class QueryEndpoint {
@ApiResponse
(
code
=
409
,
message
=
"The container image is not supported."
),})
public
ResponseEntity
<
QueryResultDto
>
reExecute
(
@NotNull
@PathVariable
(
"id"
)
Long
id
,
@NotNull
@PathVariable
(
"databaseId"
)
Long
databaseId
,
@NotNull
@PathVariable
(
"queryId"
)
Long
queryId
)
@NotNull
@PathVariable
(
"queryId"
)
Long
queryId
,
@RequestParam
(
"page"
)
Long
page
,
@RequestParam
(
"size"
)
Long
size
)
throws
QueryStoreException
,
QueryNotFoundException
,
DatabaseNotFoundException
,
ImageNotSupportedException
,
TableNotFoundException
,
QueryMalformedException
,
ContainerNotFoundException
,
SQLException
,
JSQLParserException
{
final
Query
query
=
storeService
.
findOne
(
id
,
databaseId
,
queryId
);
log
.
debug
(
query
.
toString
());
final
QueryResultDto
result
=
queryService
.
reExecute
(
id
,
databaseId
,
query
);
final
QueryResultDto
result
=
queryService
.
reExecute
(
id
,
databaseId
,
query
,
page
,
size
);
result
.
setId
(
queryId
);
return
ResponseEntity
.
status
(
HttpStatus
.
ACCEPTED
)
.
body
(
result
);
Loading