Skip to content

Commit

Permalink
Few stability improvements for deleting joined items
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Feb 10, 2020
1 parent 638c30f commit d60aefd
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 168 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ jobreport*csv
/profiles/test/config.properties
/profiles/prod/config.properties
dependency-reduced-pom.xml
DataShot.iml
DataShot-*.jar
imagecapture*.log
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="https://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.harvard.mcz</groupId>
<artifactId>DataShot</artifactId>
Expand Down Expand Up @@ -95,12 +95,12 @@
<repository>
<id>central</id>
<name>Maven Central</name>
<url>http://repo1.maven.org/maven2/</url>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>jeecg</id>
<name>JEECG</name>
<url>http://maven.jeecg.org/nexus/content/repositories/jeecg/</url>
<url>https://maven.jeecg.org/nexus/content/repositories/jeecg/</url>
</repository>
</repositories>
<dependencies>
Expand Down Expand Up @@ -248,15 +248,15 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>5.3.0.Beta1</version>
<version>5.4.10.Final</version>
</dependency>
<dependency>
<!-- TODO -->
<!--<groupId>org.hibernate.orm</groupId>-->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<!--<version>6.0.0.Alpha2</version>-->
<version>5.4.4.Final</version>
<version>5.4.11.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ public boolean hasPreviousSpecimenInTable() {
return result;
}

public boolean setSpecimen(Specimen aSpecimen) {
if (aSpecimen != null) {
specimen = aSpecimen;
return true;
}
return false;
}

public boolean setSpecimen(Long aSpecimenID) throws NoSuchRecordException {
boolean result = false;
SpecimenLifeCycle sls = new SpecimenLifeCycle();
Expand Down Expand Up @@ -270,7 +278,10 @@ public boolean save() throws SaveFailedException {
// reload the specimen
// Why??? Because we can. Also, to kinda show if more than one
// user edited the same species
specimen = s.findById(specimen.getSpecimenId());
Specimen updatedSpecimen = s.findById(specimen.getSpecimenId());
if (updatedSpecimen != null) {
specimen = updatedSpecimen;
}
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@
</key>
<one-to-many class="edu.harvard.mcz.imagecapture.entity.SpecimenPart"/>
</set>
<set name="LatLong" cascade="all-delete-orphan" fetch="subselect">
<set name="LatLong" cascade="all" fetch="subselect">
<key>
<column name="SpecimenId"/>
</key>
<one-to-many class="edu.harvard.mcz.imagecapture.entity.LatLong"/>
</set>
<set name="externalHistory" cascade="all-delete-orphan" fetch="subselect">
<set name="externalHistory" cascade="all" fetch="subselect">
<key>
<column name="SpecimenId"/>
</key>
Expand Down
Loading

0 comments on commit d60aefd

Please sign in to comment.