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
Commits
b8865342
Verified
Commit
b8865342
authored
2 years ago
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Hotfix nullpointer
parent
84562e2b
No related branches found
No related tags found
1 merge request
!163
Relase 1.3.0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dbrepo-query-service/services/src/main/java/at/tuwien/mapper/QueryMapper.java
+24
-10
24 additions, 10 deletions
.../services/src/main/java/at/tuwien/mapper/QueryMapper.java
docker-compose.dbrepo2.yml
+0
-3
0 additions, 3 deletions
docker-compose.dbrepo2.yml
with
24 additions
and
13 deletions
dbrepo-query-service/services/src/main/java/at/tuwien/mapper/QueryMapper.java
+
24
−
10
View file @
b8865342
...
@@ -627,6 +627,14 @@ public interface QueryMapper {
...
@@ -627,6 +627,14 @@ public interface QueryMapper {
log
.
error
(
"Timestamp is null"
);
log
.
error
(
"Timestamp is null"
);
throw
new
IllegalArgumentException
(
"Please provide a timestamp before"
);
throw
new
IllegalArgumentException
(
"Please provide a timestamp before"
);
}
}
if
(
page
==
null
)
{
log
.
warn
(
"page is null, default to 0"
);
page
=
0L
;
}
if
(
size
==
null
)
{
log
.
warn
(
"size is null, default to 100"
);
size
=
100L
;
}
query
=
query
.
toLowerCase
(
Locale
.
ROOT
)
query
=
query
.
toLowerCase
(
Locale
.
ROOT
)
.
trim
();
.
trim
();
if
(
query
.
matches
(
";$"
))
{
if
(
query
.
matches
(
";$"
))
{
...
@@ -760,10 +768,11 @@ public interface QueryMapper {
...
@@ -760,10 +768,11 @@ public interface QueryMapper {
return
null
;
return
null
;
}
}
switch
(
column
.
getColumnType
())
{
switch
(
column
.
getColumnType
())
{
case
BLOB
:
case
BLOB
->
{
log
.
trace
(
"mapping {} to blob"
,
data
);
log
.
trace
(
"mapping {} to blob"
,
data
);
return
new
MariaDbBlob
((
byte
[])
data
);
return
new
MariaDbBlob
((
byte
[])
data
);
case
DATE:
}
case
DATE
->
{
if
(
column
.
getDateFormat
()
==
null
)
{
if
(
column
.
getDateFormat
()
==
null
)
{
log
.
error
(
"Missing date format for column {} of table {}"
,
column
.
getId
(),
log
.
error
(
"Missing date format for column {} of table {}"
,
column
.
getId
(),
column
.
getTable
().
getId
());
column
.
getTable
().
getId
());
...
@@ -777,7 +786,8 @@ public interface QueryMapper {
...
@@ -777,7 +786,8 @@ public interface QueryMapper {
final
LocalDate
date
=
LocalDate
.
parse
(
String
.
valueOf
(
data
),
formatter
);
final
LocalDate
date
=
LocalDate
.
parse
(
String
.
valueOf
(
data
),
formatter
);
return
date
.
atStartOfDay
(
ZoneId
.
of
(
"UTC"
))
return
date
.
atStartOfDay
(
ZoneId
.
of
(
"UTC"
))
.
toInstant
();
.
toInstant
();
case
TIMESTAMP:
}
case
TIMESTAMP
->
{
if
(
column
.
getDateFormat
()
==
null
)
{
if
(
column
.
getDateFormat
()
==
null
)
{
log
.
error
(
"Missing date format for column {} of table {}"
,
column
.
getId
(),
log
.
error
(
"Missing date format for column {} of table {}"
,
column
.
getId
(),
column
.
getTable
().
getId
());
column
.
getTable
().
getId
());
...
@@ -786,25 +796,29 @@ public interface QueryMapper {
...
@@ -786,25 +796,29 @@ public interface QueryMapper {
log
.
trace
(
"mapping {} to timestamp with format '{}'"
,
data
,
column
.
getDateFormat
());
log
.
trace
(
"mapping {} to timestamp with format '{}'"
,
data
,
column
.
getDateFormat
());
return
Timestamp
.
valueOf
(
data
.
toString
())
return
Timestamp
.
valueOf
(
data
.
toString
())
.
toInstant
();
.
toInstant
();
case
ENUM:
}
case
TEXT:
case
ENUM
,
TEXT
,
STRING
->
{
case
STRING:
log
.
trace
(
"mapping {} to character array"
,
data
);
log
.
trace
(
"mapping {} to character array"
,
data
);
return
String
.
valueOf
(
data
);
return
String
.
valueOf
(
data
);
case
NUMBER:
}
case
NUMBER
->
{
log
.
trace
(
"mapping {} to non-decimal number"
,
data
);
log
.
trace
(
"mapping {} to non-decimal number"
,
data
);
return
new
BigInteger
(
String
.
valueOf
(
data
));
return
new
BigInteger
(
String
.
valueOf
(
data
));
case
DECIMAL:
}
case
DECIMAL
->
{
log
.
trace
(
"mapping {} to decimal number"
,
data
);
log
.
trace
(
"mapping {} to decimal number"
,
data
);
return
Double
.
valueOf
(
String
.
valueOf
(
data
));
return
Double
.
valueOf
(
String
.
valueOf
(
data
));
case
BOOLEAN:
}
case
BOOLEAN
->
{
log
.
trace
(
"mapping {} to boolean"
,
data
);
log
.
trace
(
"mapping {} to boolean"
,
data
);
return
Boolean
.
valueOf
(
String
.
valueOf
(
data
));
return
Boolean
.
valueOf
(
String
.
valueOf
(
data
));
default
:
}
default
->
{
log
.
warn
(
"column type {} is not known"
,
column
.
getColumnType
());
log
.
warn
(
"column type {} is not known"
,
column
.
getColumnType
());
throw
new
IllegalArgumentException
(
"Column type not known"
);
throw
new
IllegalArgumentException
(
"Column type not known"
);
}
}
}
}
}
@Named
(
"EscapedString"
)
@Named
(
"EscapedString"
)
default
String
stringToEscapedString
(
String
name
)
{
default
String
stringToEscapedString
(
String
name
)
{
...
...
This diff is collapsed.
Click to expand it.
docker-compose.dbrepo2.yml
+
0
−
3
View file @
b8865342
...
@@ -313,9 +313,6 @@ services:
...
@@ -313,9 +313,6 @@ services:
networks
:
networks
:
core
:
core
:
public
:
public
:
ports
:
-
"
80:80"
-
"
443:443"
volumes
:
volumes
:
-
./dbrepo.conf:/etc/nginx/conf.d/default.conf
-
./dbrepo.conf:/etc/nginx/conf.d/default.conf
depends_on
:
depends_on
:
...
...
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