Commit ec6fc69b authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '131-rename-tables' into 'master'

Resolve "Rename tables"

Closes #131

See merge request !128
parents 6ab63143 bbea9b37
......@@ -35,7 +35,6 @@ import javax.persistence.OneToMany;
import javax.persistence.OrderColumn;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import org.genesys.blocks.auditlog.annotations.Audited;
import org.genesys.blocks.model.Publishable;
......@@ -60,7 +59,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
*/
@Entity
@Cacheable
@Table(name = "dataset")
@Audited
public class Dataset extends UuidModel implements Publishable, SelfCleaning, PublishValidationInterface, AclAwareModel {
......@@ -82,21 +80,21 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
/** The accession identifiers. */
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "datasetaccessions", joinColumns = @JoinColumn(name = "datasetId"),
@CollectionTable(name = "datasetAccessions", joinColumns = @JoinColumn(name = "datasetId"),
// index
indexes = { @Index(columnList = "datasetId, instCode, acceNumb"), @Index(columnList = "datasetId, genus") })
private Set<AccessionIdentifier> accessionIdentifiers;
/** The descriptors. */
@ManyToMany(fetch = FetchType.LAZY, cascade = {})
@JoinTable(name = "datasetdescriptor", joinColumns = @JoinColumn(name = "datasetId", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "descriptorId", referencedColumnName = "id"))
@JoinTable(name = "datasetDescriptor", joinColumns = @JoinColumn(name = "datasetId", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "descriptorId", referencedColumnName = "id"))
@OrderColumn(name = "position")
private List<Descriptor> descriptors;
/** The repository files. */
@PublishValidation
@OneToMany(fetch = FetchType.LAZY, cascade = {})
@JoinTable(name = "datasetrepositoryfile", joinColumns = @JoinColumn(name = "datasetId", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "repositoryfileId", referencedColumnName = "id"))
@JoinTable(name = "datasetRepositoryfile", joinColumns = @JoinColumn(name = "datasetId", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "repositoryfileId", referencedColumnName = "id"))
@OrderColumn(name = "position")
private List<RepositoryFile> repositoryFiles;
......@@ -108,7 +106,7 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
/** The locations. */
@PublishValidation(innerCheck = true)
@OneToMany(cascade = { CascadeType.ALL }, mappedBy = "dataset", orphanRemoval = true, fetch = FetchType.LAZY)
private List<Location> locations;
private List<DatasetLocation> locations;
/** The accession count. */
// Number of accessions in the {@link #accessionIdentifiers} list
......@@ -257,7 +255,7 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
*
* @return the locations
*/
public List<Location> getLocations() {
public List<DatasetLocation> getLocations() {
return locations;
}
......@@ -266,7 +264,7 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
*
* @param locations the new locations
*/
public void setLocations(final List<Location> locations) {
public void setLocations(final List<DatasetLocation> locations) {
this.locations = locations;
}
......
......@@ -25,7 +25,6 @@ import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.genesys.blocks.model.UuidModel;
import org.genesys.catalog.annotations.PublishValidation;
......@@ -39,7 +38,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
* @author Andrey Lugovskoy.
*/
@Entity
@Table(name = "datasetcreator")
public class DatasetCreator extends UuidModel implements PublishValidationInterface {
/**
......
......@@ -30,12 +30,12 @@ import org.genesys.catalog.service.PublishValidationInterface;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* The Class Location.
* The Class DatasetLocation.
*
* @author Andrey Lugovskoy.
*/
@Entity
public class Location extends UuidModel implements PublishValidationInterface {
public class DatasetLocation extends UuidModel implements PublishValidationInterface {
/**
*
......@@ -74,7 +74,7 @@ public class Location extends UuidModel implements PublishValidationInterface {
/**
* Instantiates a new location.
*/
public Location() {
public DatasetLocation() {
}
/**
......
......@@ -30,7 +30,6 @@ import javax.persistence.ManyToOne;
import javax.persistence.OrderColumn;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import org.genesys.blocks.auditlog.annotations.Audited;
import org.genesys.blocks.model.Publishable;
......@@ -48,7 +47,6 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
* @author Andrey Lugovskoy
*/
@Entity
@Table(name = "descriptorlist")
@Audited
@Cacheable
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "uuid")
......@@ -85,7 +83,7 @@ public class DescriptorList extends UuidModel implements Publishable, SelfCleani
/** The descriptors. */
@ManyToMany(cascade = { CascadeType.REMOVE, CascadeType.REFRESH }, fetch = FetchType.LAZY)
@JoinTable(name = "descriptorlistdescriptor", joinColumns = @JoinColumn(name = "descriptorListId", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "descriptorId", referencedColumnName = "id"))
@JoinTable(name = "descriptorListDescriptor", joinColumns = @JoinColumn(name = "descriptorListId", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "descriptorId", referencedColumnName = "id"))
@OrderColumn(name = "position")
List<Descriptor> descriptors;
......
......@@ -17,7 +17,7 @@ package org.genesys.catalog.persistence.dataset;
import java.util.UUID;
import org.genesys.catalog.model.dataset.Location;
import org.genesys.catalog.model.dataset.DatasetLocation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
......@@ -27,12 +27,12 @@ import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* The Interface LocationRepository.
* The Interface DatasetLocationRepository.
*
* @author Andrey Lugovskoy.
*/
@Repository
public interface LocationRepository extends JpaRepository<Location, Long>, QueryDslPredicateExecutor<Location> {
public interface DatasetLocationRepository extends JpaRepository<DatasetLocation, Long>, QueryDslPredicateExecutor<DatasetLocation> {
/**
* Find by uuid.
......@@ -40,7 +40,7 @@ public interface LocationRepository extends JpaRepository<Location, Long>, Query
* @param uuid the uuid
* @return the location
*/
Location findByUuid(UUID uuid);
DatasetLocation findByUuid(UUID uuid);
/**
* List by U uid of dataset.
......@@ -49,7 +49,7 @@ public interface LocationRepository extends JpaRepository<Location, Long>, Query
* @param uuid the uuid
* @return the page
*/
@Query("select distinct loc from Location loc where loc.dataset.uuid = :uuid")
Page<Location> listByUUidOfDataset(Pageable page, @Param("uuid") UUID uuid);
@Query("select distinct loc from DatasetLocation loc where loc.dataset.uuid = :uuid")
Page<DatasetLocation> listByUUidOfDataset(Pageable page, @Param("uuid") UUID uuid);
}
......@@ -19,7 +19,7 @@ import java.util.List;
import java.util.UUID;
import org.genesys.catalog.exceptions.NotFoundElement;
import org.genesys.catalog.model.dataset.Location;
import org.genesys.catalog.model.dataset.DatasetLocation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
......@@ -31,60 +31,60 @@ import org.springframework.data.domain.Pageable;
public interface LocationService {
/**
* Method adding Location to Dataset.
* Method adding DatasetLocation to Dataset.
*
* @param datasetUuid dataset UUID
* @param input Location
* @return added Location
* @param input DatasetLocation
* @return added DatasetLocation
* @throws NotFoundElement the not found element
*/
Location createLocation(UUID datasetUuid, Location input) throws NotFoundElement;
DatasetLocation createLocation(UUID datasetUuid, DatasetLocation input) throws NotFoundElement;
/**
* Method for remove Location of Dataset.
* Method for remove DatasetLocation of Dataset.
*
* @param datasetUuid dataset UUID
* @param input Location
* @return removed Location
* @param input DatasetLocation
* @return removed DatasetLocation
* @throws NotFoundElement the not found element
*/
Location removeLocation(UUID datasetUuid, Location input) throws NotFoundElement;
DatasetLocation removeLocation(UUID datasetUuid, DatasetLocation input) throws NotFoundElement;
/**
* Method for getting Location list of Dataset.
* Method for getting DatasetLocation list of Dataset.
*
* @param datasetUuid dataset UUID
* @return loaded List
* @throws NotFoundElement the not found element
*/
List<Location> listLocation(UUID datasetUuid) throws NotFoundElement;
List<DatasetLocation> listLocation(UUID datasetUuid) throws NotFoundElement;
/**
* Method for getting Location list of Dataset.
* Method for getting DatasetLocation list of Dataset.
*
* @param datasetUuid Dataset UUID
* @param page page
* @return page with loaded list Location
* @return page with loaded list DatasetLocation
*/
Page<Location> listLocation(UUID datasetUuid, Pageable page);
Page<DatasetLocation> listLocation(UUID datasetUuid, Pageable page);
/**
* Method for getting Location by UUID.
* Method for getting DatasetLocation by UUID.
*
* @param input Location input
* @return loaded Location
* @param input DatasetLocation input
* @return loaded DatasetLocation
* @throws NotFoundElement the not found element
*/
Location loadLocation(Location input) throws NotFoundElement;
DatasetLocation loadLocation(DatasetLocation input) throws NotFoundElement;
/**
* Method for getting Location by UUID.
* Method for getting DatasetLocation by UUID.
*
* @param locationUuid Location UUID
* @return loaded Location
* @param locationUuid DatasetLocation UUID
* @return loaded DatasetLocation
* @throws NotFoundElement the not found element
*/
Location loadLocation(UUID locationUuid) throws NotFoundElement;
DatasetLocation loadLocation(UUID locationUuid) throws NotFoundElement;
/**
* Method for update location.
......@@ -94,6 +94,6 @@ public interface LocationService {
* @return updated location
* @throws NotFoundElement the not found element
*/
Location updateLocation(UUID datasetUuid, Location input) throws NotFoundElement;
DatasetLocation updateLocation(UUID datasetUuid, DatasetLocation input) throws NotFoundElement;
}
......@@ -20,8 +20,8 @@ import java.util.UUID;
import org.genesys.catalog.exceptions.NotFoundElement;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.Location;
import org.genesys.catalog.persistence.dataset.LocationRepository;
import org.genesys.catalog.model.dataset.DatasetLocation;
import org.genesys.catalog.persistence.dataset.DatasetLocationRepository;
import org.genesys.catalog.service.DatasetService;
import org.genesys.catalog.service.LocationService;
import org.slf4j.Logger;
......@@ -48,15 +48,15 @@ public class LocationServiceImpl implements LocationService {
private DatasetService datasetService;
@Autowired
private LocationRepository locationRepository;
private DatasetLocationRepository locationRepository;
/**
* {@inheritDoc}
*/
@Override
@Transactional
public Location createLocation(final UUID datasetUuid, final Location input) throws NotFoundElement {
LOG.info("Create Location {} for dataset {}", input, datasetUuid);
public DatasetLocation createLocation(final UUID datasetUuid, final DatasetLocation input) throws NotFoundElement {
LOG.info("Create DatasetLocation {} for dataset {}", input, datasetUuid);
final Dataset dataset = datasetService.loadDataset(datasetUuid);
input.setDataset(dataset);
return locationRepository.save(input);
......@@ -67,19 +67,19 @@ public class LocationServiceImpl implements LocationService {
*/
@Override
@Transactional
public Location removeLocation(final UUID datasetUuid, final Location input) throws NotFoundElement {
LOG.info("Remove Location {} of dataset {}", input, datasetUuid);
final Location location = loadLocation(input);
locationRepository.delete(location);
return location;
public DatasetLocation removeLocation(final UUID datasetUuid, final DatasetLocation input) throws NotFoundElement {
LOG.info("Remove DatasetLocation {} of dataset {}", input, datasetUuid);
final DatasetLocation datasetLocation = loadLocation(input);
locationRepository.delete(datasetLocation);
return datasetLocation;
}
/**
* {@inheritDoc}
*/
@Override
public List<Location> listLocation(final UUID datasetUuid) throws NotFoundElement {
LOG.info("Load list Location for dataset {}", datasetUuid);
public List<DatasetLocation> listLocation(final UUID datasetUuid) throws NotFoundElement {
LOG.info("Load list DatasetLocation for dataset {}", datasetUuid);
final Dataset dataset = datasetService.loadDataset(datasetUuid);
dataset.getLocations().size();
return dataset.getLocations();
......@@ -89,8 +89,8 @@ public class LocationServiceImpl implements LocationService {
* {@inheritDoc}
*/
@Override
public Page<Location> listLocation(final UUID datasetUuid, final Pageable page) {
LOG.info("Load list Location for dataset {}", datasetUuid);
public Page<DatasetLocation> listLocation(final UUID datasetUuid, final Pageable page) {
LOG.info("Load list DatasetLocation for dataset {}", datasetUuid);
return locationRepository.listByUUidOfDataset(page, datasetUuid);
}
......@@ -98,44 +98,44 @@ public class LocationServiceImpl implements LocationService {
* {@inheritDoc}
*/
@Override
public Location loadLocation(final Location input) throws NotFoundElement {
LOG.info("Load list Location {}", input);
public DatasetLocation loadLocation(final DatasetLocation input) throws NotFoundElement {
LOG.info("Load list DatasetLocation {}", input);
final Location location = locationRepository.findByUuid(input.getUuid());
final DatasetLocation datasetLocation = locationRepository.findByUuid(input.getUuid());
if (location == null) {
LOG.error("Location by UUID {} not found", input);
throw new NotFoundElement("Location " + input.getUuid().toString() + " no found");
if (datasetLocation == null) {
LOG.error("DatasetLocation by UUID {} not found", input);
throw new NotFoundElement("DatasetLocation " + input.getUuid().toString() + " no found");
}
if (!location.getVersion().equals(input.getVersion())) {
if (!datasetLocation.getVersion().equals(input.getVersion())) {
LOG.error("Don't match the version");
throw new ConcurrencyFailureException("Object version changed to " + location.getVersion() + ", you provided " + input.getVersion());
throw new ConcurrencyFailureException("Object version changed to " + datasetLocation.getVersion() + ", you provided " + input.getVersion());
}
return location;
return datasetLocation;
}
/**
* {@inheritDoc}
*/
@Override
public Location loadLocation(final UUID locationUuid) throws NotFoundElement {
LOG.info("Load list Location by uuid {}", locationUuid);
public DatasetLocation loadLocation(final UUID locationUuid) throws NotFoundElement {
LOG.info("Load list DatasetLocation by uuid {}", locationUuid);
final Location location = locationRepository.findByUuid(locationUuid);
final DatasetLocation datasetLocation = locationRepository.findByUuid(locationUuid);
if (location == null) {
LOG.error("Location by UUID {} not found", locationUuid);
if (datasetLocation == null) {
LOG.error("DatasetLocation by UUID {} not found", locationUuid);
throw new NotFoundElement("DatasetCreator by " + locationUuid.toString() + " no found");
}
return location;
return datasetLocation;
}
@Override
@Transactional
public Location updateLocation(final UUID datasetUuid, final Location input) throws NotFoundElement {
final Location location = loadLocation(input);
copyValue(location, input);
return locationRepository.save(location);
public DatasetLocation updateLocation(final UUID datasetUuid, final DatasetLocation input) throws NotFoundElement {
final DatasetLocation datasetLocation = loadLocation(input);
copyValue(datasetLocation, input);
return locationRepository.save(datasetLocation);
}
/**
......@@ -144,7 +144,7 @@ public class LocationServiceImpl implements LocationService {
* @param target the target
* @param source the source
*/
protected void copyValue(final Location target, final Location source) {
protected void copyValue(final DatasetLocation target, final DatasetLocation source) {
target.setUserCountry(source.getUserCountry());
target.setMapCountry(source.getMapCountry());
target.setStateProvince(source.getStateProvince());
......
......@@ -74,12 +74,12 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel {
/// partner-associated web links
@ElementCollection
@CollectionTable(name = "partnerurl", joinColumns = @JoinColumn(name = "partnerId"))
@CollectionTable(name = "partnerUrl", joinColumns = @JoinColumn(name = "partnerId"))
private Set<URL> urls;
/// FAO WIEWS codes associated with this partner
@ElementCollection
@CollectionTable(name = "partnerwiews", joinColumns = @JoinColumn(name = "partnerId"))
@CollectionTable(name = "partnerWiews", joinColumns = @JoinColumn(name = "partnerId"))
@Column(name = "wiews")
private Set<String> wiewsCodes;
......
......@@ -21,7 +21,7 @@ import java.util.Set;
import org.genesys.catalog.model.dataset.AccessionIdentifier;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.DatasetCreator;
import org.genesys.catalog.model.dataset.Location;
import org.genesys.catalog.model.dataset.DatasetLocation;
import org.genesys.catalog.persistence.dataset.DatasetRepository;
import org.genesys.catalog.persistence.dataset.DatasetVersionsRepository;
import org.genesys.catalog.test.CatalogServiceTest;
......@@ -96,13 +96,13 @@ public abstract class AbstractDatasetServiceTest extends CatalogServiceTest {
return datasetCreator;
}
Location buildLocation(Dataset dataset, String userCountry, String mapCountry, Double decimalLatitude) {
Location location = new Location();
location.setDataset(dataset);
location.setUserCountry(userCountry);
location.setMapCountry(mapCountry);
location.setDecimalLatitude(decimalLatitude);
return location;
DatasetLocation buildLocation(Dataset dataset, String userCountry, String mapCountry, Double decimalLatitude) {
DatasetLocation datasetLocation = new DatasetLocation();
datasetLocation.setDataset(dataset);
datasetLocation.setUserCountry(userCountry);
datasetLocation.setMapCountry(mapCountry);
datasetLocation.setDecimalLatitude(decimalLatitude);
return datasetLocation;
}
protected AccessionIdentifier makeAccessionIdentifier(String instCode, String acceNumb, String genus, String doi) {
......
......@@ -28,8 +28,8 @@ import java.util.UUID;
import org.genesys.catalog.exceptions.NotFoundElement;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.Location;
import org.genesys.catalog.persistence.dataset.LocationRepository;
import org.genesys.catalog.model.dataset.DatasetLocation;
import org.genesys.catalog.persistence.dataset.DatasetLocationRepository;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.ConcurrencyFailureException;
......@@ -47,7 +47,7 @@ public class LocationServiceImplTest extends AbstractDatasetServiceTest {
private LocationService locationService;
@Autowired
private LocationRepository locationRepository;
private DatasetLocationRepository locationRepository;
@Override
public void cleanup() {
......@@ -58,37 +58,37 @@ public class LocationServiceImplTest extends AbstractDatasetServiceTest {
@Test
public void addLocation() throws Exception {
Dataset input = buildAndSaveDataset(DATASET_TITLE_1, DATASET_DESCRIPTION_1, partner, false);
Location location = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
assertThat(location, is(not(nullValue())));
assertThat(location.getDataset().getUuid().toString(), equalTo(input.getUuid().toString()));
DatasetLocation datasetLocation = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
assertThat(datasetLocation, is(not(nullValue())));
assertThat(datasetLocation.getDataset().getUuid().toString(), equalTo(input.getUuid().toString()));
}
@Test
public void removeLocation() throws Exception {
Dataset input = buildAndSaveDataset(DATASET_TITLE_1, DATASET_DESCRIPTION_1, partner, false);
Location location = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
DatasetLocation datasetLocation = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
input = datasetService.loadDataset(input.getUuid());
assertThat(input.getLocations(), hasSize(1));
Location removedLocation = locationService.removeLocation(input.getUuid(), location);
DatasetLocation removedDatasetLocation = locationService.removeLocation(input.getUuid(), datasetLocation);
input = datasetService.loadDataset(input.getUuid());
assertThat(location, equalTo(removedLocation));
assertThat(datasetLocation, equalTo(removedDatasetLocation));
assertThat(input.getLocations(), hasSize(0));
}
@Test
public void listLocation() throws Exception {
Dataset input = buildAndSaveDataset(DATASET_TITLE_1, DATASET_DESCRIPTION_1, partner, false);
Location location = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
List<Location> locations = locationService.listLocation(input.getUuid());
assertThat(locations, is(notNullValue()));
assertThat(locations, hasSize(1));
assertThat(locations.contains(location), is(true));
DatasetLocation datasetLocation = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
List<DatasetLocation> datasetLocations = locationService.listLocation(input.getUuid());
assertThat(datasetLocations, is(notNullValue()));
assertThat(datasetLocations, hasSize(1));
assertThat(datasetLocations.contains(datasetLocation), is(true));
}
@Test
public void pageListLocation() throws Exception {
Dataset input = buildAndSaveDataset(DATASET_TITLE_1, DATASET_DESCRIPTION_1, partner, false);
Location location = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
DatasetLocation datasetLocation = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
String[] strs = new String[] { "userCountry" };
Pageable pageable = new PageRequest(0, Integer.min(50, 100), Sort.Direction.ASC, strs);
......@@ -96,54 +96,54 @@ public class LocationServiceImplTest extends AbstractDatasetServiceTest {
Page<?> page = locationService.listLocation(input.getUuid(), pageable);
assertThat(page.getTotalElements(), is(1L));
assertThat(((Location) page.getContent().get(0)).getUuid(), is(location.getUuid()));
assertThat(((DatasetLocation) page.getContent().get(0)).getUuid(), is(datasetLocation.getUuid()));
}
@Test
public void loadDataset() throws Exception {
Dataset input = buildAndSaveDataset(DATASET_TITLE_1, DATASET_DESCRIPTION_1, partner, false);
Location location = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
Location loaded = locationService.loadLocation(location);
DatasetLocation datasetLocation = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
DatasetLocation loaded = locationService.loadLocation(datasetLocation);
assertThat(loaded, is(notNullValue()));
assertThat(location, equalTo(loaded));
assertThat(datasetLocation, equalTo(loaded));
}
@Test(expected = NotFoundElement.class)
public void loadDataset1() throws Exception {
Dataset input = buildAndSaveDataset(DATASET_TITLE_1, DATASET_DESCRIPTION_1, partner, false);
Location location = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
location.setUuid(UUID.randomUUID());
locationService.loadLocation(location);
DatasetLocation datasetLocation = locationService.createLocation(input.getUuid(), buildLocation(null, "UserCountry", "MapCountry", 0d));
datasetLocation.setUuid(UUID.randomUUID());
locationService.loadLocation(datasetLocation);
}
@Test(expected = ConcurrencyFailureException.class)
public void loadDataset2() throws