Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
04bbeffc
Commit
04bbeffc
authored
Jul 15, 2018
by
Matija Obreza
Browse files
Treat lat/lon (0, 0) as null
parent
7ef9f80f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/model/genesys/AccessionGeo.java
View file @
04bbeffc
...
...
@@ -68,6 +68,13 @@ public class AccessionGeo extends BasicModel implements GeoReferencedEntity, Acc
@PreUpdate
private
void
prePersist
()
{
trimStringsToNull
();
// Treat (0, 0) as null
if
((
this
.
longitude
==
0
||
this
.
longitude
==
null
)
&&
(
this
.
latitude
==
0
||
this
.
latitude
==
null
))
{
this
.
longitude
=
null
;
this
.
latitude
=
null
;
}
tileIndex
=
WorldClimUtil
.
getTileIndex
(
5
,
this
.
longitude
,
this
.
latitude
);
}
...
...
src/main/java/org/genesys2/server/model/genesys/AccessionId.java
View file @
04bbeffc
...
...
@@ -126,6 +126,16 @@ public class AccessionId extends AuditedVersionedModel implements IdUUID {
if
(
uuid
==
null
)
{
uuid
=
UUID
.
randomUUID
();
}
// Remove empty AccessionGeo
if
(
this
.
geo
!=
null
&&
this
.
geo
.
isEmpty
())
{
this
.
geo
=
null
;
}
// Remove empty AccessionCollect
if
(
this
.
coll
!=
null
&&
this
.
coll
.
isEmpty
())
{
this
.
coll
=
null
;
}
}
@Override
...
...
src/main/java/org/genesys2/server/servlet/controller/admin/AdminController.java
View file @
04bbeffc
...
...
@@ -28,7 +28,6 @@ import javax.persistence.PersistenceContext;
import
javax.xml.parsers.ParserConfigurationException
;
import
org.apache.commons.lang.time.StopWatch
;
import
org.genesys2.server.persistence.domain.AccessionIdRepository
;
import
org.genesys2.server.persistence.domain.AccessionRepository
;
import
org.genesys2.server.service.ContentService
;
import
org.genesys2.server.service.CountryNamesUpdater
;
...
...
Matija Obreza
@mobreza
mentioned in issue
#263 (closed)
·
Jul 16, 2018
mentioned in issue
#263 (closed)
mentioned in issue #263
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment