Commit 0783f042 authored by Matija Obreza's avatar Matija Obreza
Browse files

DatasetLocation: Added ISO3 country code

parent 37d971e1
/* /*
* Copyright 2017 Global Crop Diversity Trust * Copyright 2018 Global Crop Diversity Trust
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -38,11 +38,17 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter ...@@ -38,11 +38,17 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter
*/ */
private static final long serialVersionUID = -3107167591979299613L; private static final long serialVersionUID = -3107167591979299613L;
/** The user country. */ /** The dataset. */
@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.DETACH }, optional = false, fetch = FetchType.EAGER)
@JoinColumn(name = "datasetId")
@JsonIgnore
private Dataset dataset;
/** The user-provided country name. */
@PublishValidation @PublishValidation
private String userCountry; private String userCountry;
/** The map country. */ /** Country as detected from coordinates. */
@PublishValidation @PublishValidation
private String mapCountry; private String mapCountry;
...@@ -61,6 +67,7 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter ...@@ -61,6 +67,7 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter
@PublishValidation @PublishValidation
private Double decimalLongitude; private Double decimalLongitude;
/** ISO3 country code of the location */
@Column(length = 3) @Column(length = 3)
private String countryCode; private String countryCode;
...@@ -72,11 +79,9 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter ...@@ -72,11 +79,9 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter
@Column(length = 8) @Column(length = 8)
private String endDate; private String endDate;
/** The dataset. */ /** Description of environment conditions. */
@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.DETACH }, optional = false, fetch = FetchType.EAGER) @Lob
@JoinColumn(name = "datasetId") private String description;
@JsonIgnore
private Dataset dataset;
/** /**
* Instantiates a new location. * Instantiates a new location.
...@@ -268,6 +273,24 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter ...@@ -268,6 +273,24 @@ public class DatasetLocation extends UuidModel implements PublishValidationInter
} }
} }
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() {
return description;
}
/**
* Sets the description.
*
* @param description the new description
*/
public void setDescription(String description) {
this.description = description;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.genesys.catalog.service.PublishValidationInterface#validation() * @see org.genesys.catalog.service.PublishValidationInterface#validation()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment