diff --git a/jacq-birt/seedorder.rptdesign b/jacq-birt/seedorder.rptdesign index 55ddf10..8245e0c 100644 --- a/jacq-birt/seedorder.rptdesign +++ b/jacq-birt/seedorder.rptdesign @@ -14,10 +14,10 @@ pojoClassPath - C:\Dev\Repositories\jacq-javaee\jacq-service-report\target\jacq-service-report.jar;C:\Dev\Repositories\jacq-javaee\jacq-common\target\jacq-common-0.8.0.jar; + C:\Dev\Repositories\jacq-javaee\jacq-service-report\target\jacq-service-report.jar;C:\Dev\Repositories\jacq-javaee\jacq-common\target\jacq-common-0.9.0.jar; - C:\Dev\Repositories\jacq-javaee\jacq-service-report\target\jacq-service-report.jar;C:\Dev\Repositories\jacq-javaee\jacq-common\target\jacq-common-0.8.0.jar; + C:\Dev\Repositories\jacq-javaee\jacq-service-report\target\jacq-service-report.jar;C:\Dev\Repositories\jacq-javaee\jacq-common\target\jacq-common-0.9.0.jar; @@ -306,6 +306,11 @@ dimension IpenNumber + + CultivarName + dimension + CultivarName + @@ -330,6 +335,11 @@ IpenNumber string + + 5 + CultivarName + string + SeedOrderDataSource @@ -362,6 +372,13 @@ string 1 + + 5 + CultivarName + CultivarName + string + 1 + @@ -377,6 +394,9 @@ + + + ]]> @@ -639,10 +659,17 @@ string true + + CultivarName + dataSetRow["CultivarName"] + string + true + +
@@ -666,6 +693,11 @@ Scientific-Name + + + + + + CultivarName + + IpenNumber @@ -702,6 +739,7 @@ + diff --git a/jacq-common/pom.xml b/jacq-common/pom.xml index de8481b..b5d82db 100644 --- a/jacq-common/pom.xml +++ b/jacq-common/pom.xml @@ -4,7 +4,7 @@ jacq org.jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-common/src/main/java/org/jacq/common/manager/BaseDerivativeManager.java b/jacq-common/src/main/java/org/jacq/common/manager/BaseDerivativeManager.java index a1421f6..e14b5c9 100644 --- a/jacq-common/src/main/java/org/jacq/common/manager/BaseDerivativeManager.java +++ b/jacq-common/src/main/java/org/jacq/common/manager/BaseDerivativeManager.java @@ -61,7 +61,7 @@ public abstract class BaseDerivativeManager { */ protected static final String FILTER_TYPE = "`type` = ?"; protected static final String FILTER_DERIVATIVEID = "`derivative_id` = ?"; - protected static final String FILTER_PLACENUMBER = "`place_number` = ?"; + protected static final String FILTER_PLACENUMBER = "`place_number` LIKE ?"; protected static final String FILTER_ACCESSIONNUMBER = "`accession_number` = ?"; protected static final String FILTER_SEPARATED = "`separated` = ?"; protected static final String FILTER_SCIENTIFIC_NAME_ID = "`scientific_name_id` = ?"; @@ -228,6 +228,7 @@ protected String applySearchCriteria(String baseSql, List params, String } if (!StringUtils.isEmpty(placeNumber)) { queryString += " AND " + FILTER_PLACENUMBER; + placeNumber = placeNumber + "%"; params.add(placeNumber); } if (!StringUtils.isEmpty(accessionNumber)) { diff --git a/jacq-common/src/main/java/org/jacq/common/manager/BaseGatheringManager.java b/jacq-common/src/main/java/org/jacq/common/manager/BaseGatheringManager.java index 5678685..acccf01 100644 --- a/jacq-common/src/main/java/org/jacq/common/manager/BaseGatheringManager.java +++ b/jacq-common/src/main/java/org/jacq/common/manager/BaseGatheringManager.java @@ -17,6 +17,8 @@ import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.persistence.EntityManager; import javax.persistence.TypedQuery; import javax.transaction.Transactional; @@ -33,6 +35,8 @@ */ public abstract class BaseGatheringManager { + private static final Logger LOGGER = Logger.getLogger(BaseGatheringManager.class.getName()); + protected EntityManager entityManager; public void setEntityManager(EntityManager entityManager) { @@ -61,27 +65,35 @@ public List locationFind(String location, Integer offset, Intege List locationResults = new ArrayList<>(); for (GeoNamesEntryResult geoNamesEntryResult : geoNamesSearchResult.getGeonames()) { - TypedQuery locationGeonamesQuery = entityManager.createNamedQuery("TblLocationGeonames.findByGeonameId", TblLocationGeonames.class); - locationGeonamesQuery.setParameter("geonameId", geoNamesEntryResult.getGeonameId()); - List locationGeonamesList = locationGeonamesQuery.getResultList(); - if (locationGeonamesList != null && locationGeonamesList.size() > 0) { - locationResults.add(new LocationResult(locationGeonamesList.get(0).getTblLocation())); - } else { - TblLocation tblLocation = new TblLocation(); - tblLocation.setLocation(geoNamesEntryResult.getName()); - entityManager.persist(tblLocation); - - TblLocationGeonames tblLocationGeonames = new TblLocationGeonames(); - tblLocationGeonames.setId(tblLocation.getId()); - tblLocationGeonames.setTblLocation(tblLocation); - tblLocationGeonames.setCountryCode(geoNamesEntryResult.getCountryCode()); - tblLocationGeonames.setGeonameId(geoNamesEntryResult.getGeonameId()); - tblLocationGeonames.setServiceData(geoNamesEntryResult.toString()); - entityManager.persist(tblLocationGeonames); - - tblLocation.setTblLocationGeonames(tblLocationGeonames); - - locationResults.add(new LocationResult(tblLocation)); + try { + TypedQuery locationGeonamesQuery = entityManager.createNamedQuery("TblLocationGeonames.findByGeonameId", TblLocationGeonames.class); + locationGeonamesQuery.setParameter("geonameId", geoNamesEntryResult.getGeonameId()); + List locationGeonamesList = locationGeonamesQuery.getResultList(); + if (locationGeonamesList != null && locationGeonamesList.size() > 0) { + locationResults.add(new LocationResult(locationGeonamesList.get(0).getTblLocation())); + } else { + if (geoNamesEntryResult.getCountryCode() == null) { + continue; + } + + TblLocation tblLocation = new TblLocation(); + tblLocation.setLocation(geoNamesEntryResult.getName()); + entityManager.persist(tblLocation); + + TblLocationGeonames tblLocationGeonames = new TblLocationGeonames(); + tblLocationGeonames.setId(tblLocation.getId()); + tblLocationGeonames.setTblLocation(tblLocation); + tblLocationGeonames.setCountryCode(geoNamesEntryResult.getCountryCode()); + tblLocationGeonames.setGeonameId(geoNamesEntryResult.getGeonameId()); + tblLocationGeonames.setServiceData(geoNamesEntryResult.toString()); + entityManager.persist(tblLocationGeonames); + + tblLocation.setTblLocationGeonames(tblLocationGeonames); + + locationResults.add(new LocationResult(tblLocation)); + } + } catch (Exception e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); } } diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignment.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignment.java index af86b4a..dab185b 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignment.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignment.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignmentPK.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignmentPK.java index d93a480..3867f53 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignmentPK.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthAssignmentPK.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthItem.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthItem.java index c049c66..bf2423c 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthItem.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkAuthItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkConfig.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkConfig.java index c97eb3a..f3f6fb0 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkConfig.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkEmploymentType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkEmploymentType.java index 3ba229a..de1bff0 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkEmploymentType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkEmploymentType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkRole.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkRole.java index 4e217a5..ed21e2a 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkRole.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkRole.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 fhafner. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ /** * - * @author fhafner + * @author wkoller */ @Entity @Table(name = "frmwrk_role") diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkTemplate.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkTemplate.java index 2071df0..1adb8f8 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkTemplate.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUser.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUser.java index 4d88893..579a058 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUser.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,12 +111,22 @@ public class FrmwrkUser implements Serializable { @JoinColumn(name = "user_id", referencedColumnName = "id")}, inverseJoinColumns = { @JoinColumn(name = "role_id", referencedColumnName = "role_id")}) private List frmwrkRoleList; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "senderUserId", fetch = FetchType.LAZY) + private List tblSeedOrderList; @OneToMany(mappedBy = "userId", fetch = FetchType.LAZY) - private List frmwrkAccessbotanicalobjectList; + private List frmwrkaccessClassificationList; @OneToMany(mappedBy = "gardenerId", fetch = FetchType.LAZY) private List tblOrganisationList; + @OneToMany(mappedBy = "userId", fetch = FetchType.LAZY) + private List frmwrkaccessOrganisationList; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "userId", fetch = FetchType.LAZY) + private List tblInventoryList; @OneToMany(cascade = CascadeType.ALL, mappedBy = "frmwrkUser", fetch = FetchType.LAZY) - private List frmwrkAuthassignmentList; + private List frmwrkAuthAssignmentList; + @OneToMany(mappedBy = "userId", fetch = FetchType.LAZY) + private List frmwrkaccessBotanicalObjectList; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "userId", fetch = FetchType.LAZY) + private List tblIndexSeminumRevisionList; @OneToMany(cascade = CascadeType.ALL, mappedBy = "userId", fetch = FetchType.LAZY) private List tblUserClassificationSourceList; @JoinColumn(name = "employment_type_id", referencedColumnName = "employment_type_id") @@ -128,10 +138,6 @@ public class FrmwrkUser implements Serializable { @JoinColumn(name = "organisation_id", referencedColumnName = "id") @ManyToOne(optional = false, fetch = FetchType.LAZY) private TblOrganisation organisationId; - @OneToMany(mappedBy = "userId", fetch = FetchType.LAZY) - private List frmwrkAccessclassificationList; - @OneToMany(mappedBy = "userId", fetch = FetchType.LAZY) - private List frmwrkAccessorganisationList; public FrmwrkUser() { } @@ -240,12 +246,21 @@ public void setFrmwrkRoleList(List frmwrkRoleList) { } @XmlTransient - public List getFrmwrkAccessbotanicalobjectList() { - return frmwrkAccessbotanicalobjectList; + public List getTblSeedOrderList() { + return tblSeedOrderList; + } + + public void setTblSeedOrderList(List tblSeedOrderList) { + this.tblSeedOrderList = tblSeedOrderList; + } + + @XmlTransient + public List getFrmwrkaccessClassificationList() { + return frmwrkaccessClassificationList; } - public void setFrmwrkAccessbotanicalobjectList(List frmwrkAccessbotanicalobjectList) { - this.frmwrkAccessbotanicalobjectList = frmwrkAccessbotanicalobjectList; + public void setFrmwrkaccessClassificationList(List frmwrkaccessClassificationList) { + this.frmwrkaccessClassificationList = frmwrkaccessClassificationList; } @XmlTransient @@ -258,12 +273,48 @@ public void setTblOrganisationList(List tblOrganisationList) { } @XmlTransient - public List getFrmwrkAuthassignmentList() { - return frmwrkAuthassignmentList; + public List getFrmwrkaccessOrganisationList() { + return frmwrkaccessOrganisationList; + } + + public void setFrmwrkaccessOrganisationList(List frmwrkaccessOrganisationList) { + this.frmwrkaccessOrganisationList = frmwrkaccessOrganisationList; + } + + @XmlTransient + public List getTblInventoryList() { + return tblInventoryList; + } + + public void setTblInventoryList(List tblInventoryList) { + this.tblInventoryList = tblInventoryList; + } + + @XmlTransient + public List getFrmwrkAuthAssignmentList() { + return frmwrkAuthAssignmentList; } - public void setFrmwrkAuthassignmentList(List frmwrkAuthassignmentList) { - this.frmwrkAuthassignmentList = frmwrkAuthassignmentList; + public void setFrmwrkAuthAssignmentList(List frmwrkAuthAssignmentList) { + this.frmwrkAuthAssignmentList = frmwrkAuthAssignmentList; + } + + @XmlTransient + public List getFrmwrkaccessBotanicalObjectList() { + return frmwrkaccessBotanicalObjectList; + } + + public void setFrmwrkaccessBotanicalObjectList(List frmwrkaccessBotanicalObjectList) { + this.frmwrkaccessBotanicalObjectList = frmwrkaccessBotanicalObjectList; + } + + @XmlTransient + public List getTblIndexSeminumRevisionList() { + return tblIndexSeminumRevisionList; + } + + public void setTblIndexSeminumRevisionList(List tblIndexSeminumRevisionList) { + this.tblIndexSeminumRevisionList = tblIndexSeminumRevisionList; } @XmlTransient @@ -299,24 +350,6 @@ public void setOrganisationId(TblOrganisation organisationId) { this.organisationId = organisationId; } - @XmlTransient - public List getFrmwrkAccessclassificationList() { - return frmwrkAccessclassificationList; - } - - public void setFrmwrkAccessclassificationList(List frmwrkAccessclassificationList) { - this.frmwrkAccessclassificationList = frmwrkAccessclassificationList; - } - - @XmlTransient - public List getFrmwrkAccessorganisationList() { - return frmwrkAccessorganisationList; - } - - public void setFrmwrkAccessorganisationList(List frmwrkAccessorganisationList) { - this.frmwrkAccessorganisationList = frmwrkAccessorganisationList; - } - @Override public int hashCode() { int hash = 0; diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUserType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUserType.java index fe99c9f..74082e2 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUserType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkUserType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessBotanicalObject.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessBotanicalObject.java index b391859..adf2dff 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessBotanicalObject.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessBotanicalObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessClassification.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessClassification.java index 0ea09cb..6cdd662 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessClassification.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessClassification.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessOrganisation.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessOrganisation.java index bf460e6..e6d6ee4 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessOrganisation.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/FrmwrkaccessOrganisation.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinter.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinter.java index 1dbde1e..28a5e9a 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinter.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinter.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,7 @@ import java.io.Serializable; import java.util.Date; -import java.util.List; import javax.persistence.Basic; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -30,14 +28,12 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; -import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; /** * @@ -77,10 +73,6 @@ public class SrvcUuidMinter implements Serializable { @JoinColumn(name = "uuid_minter_type_id", referencedColumnName = "uuid_minter_type_id") @ManyToOne(optional = false, fetch = FetchType.LAZY) private SrvcUuidMinterType uuidMinterTypeId; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "uuidMinterId", fetch = FetchType.LAZY) - private List revFloraList; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "uuidMinterId", fetch = FetchType.LAZY) - private List revClassificationList; public SrvcUuidMinter() { } @@ -136,24 +128,6 @@ public void setUuidMinterTypeId(SrvcUuidMinterType uuidMinterTypeId) { this.uuidMinterTypeId = uuidMinterTypeId; } - @XmlTransient - public List getRevFloraList() { - return revFloraList; - } - - public void setRevFloraList(List revFloraList) { - this.revFloraList = revFloraList; - } - - @XmlTransient - public List getRevClassificationList() { - return revClassificationList; - } - - public void setRevClassificationList(List revClassificationList) { - this.revClassificationList = revClassificationList; - } - @Override public int hashCode() { int hash = 0; diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinterType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinterType.java index 2f3f1ff..d0bfa8e 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinterType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/SrvcUuidMinterType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAccessionNumber.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAccessionNumber.java index f5db617..e91f404 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAccessionNumber.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAccessionNumber.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionDate.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionDate.java index 23b8cb9..c700328 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionDate.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionDate.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEvent.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEvent.java index c332fbc..c33d7af 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEvent.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEventSource.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEventSource.java index a23a75e..70f772c 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEventSource.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionEventSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionSource.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionSource.java index dd28305..4b89b0f 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionSource.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ public class TblAcquisitionSource implements Serializable { @Size(min = 1, max = 255) @Column(name = "name") private String name; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "acquisitionSourceId", fetch = FetchType.LAZY, orphanRemoval = true) + @OneToMany(cascade = CascadeType.ALL, mappedBy = "acquisitionSourceId", fetch = FetchType.LAZY) private List tblAcquisitionEventSourceList; public TblAcquisitionSource() { diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionType.java index 7e60cb7..5c8d51a 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAcquisitionType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAlternativeAccessionNumber.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAlternativeAccessionNumber.java index f2874c5..8a65fac 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAlternativeAccessionNumber.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblAlternativeAccessionNumber.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblBotanicalObject.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblBotanicalObject.java index f2fa6c8..043e809 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblBotanicalObject.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblBotanicalObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 fhafner. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ /** * - * @author fhafner + * @author wkoller */ @Entity @Table(name = "tbl_botanical_object") @@ -72,7 +72,7 @@ public class TblBotanicalObject implements Serializable { @Basic(optional = false) @NotNull @Column(name = "scientific_name_id") - private Long scientificNameId; + private long scientificNameId; @Column(name = "determination_date") @Temporal(TemporalType.DATE) private Date determinationDate; @@ -133,6 +133,8 @@ public class TblBotanicalObject implements Serializable { @OneToMany(cascade = CascadeType.ALL, mappedBy = "botanicalObjectId", fetch = FetchType.LAZY) private List tblIndexSeminumContentList; @OneToMany(cascade = CascadeType.ALL, mappedBy = "botanicalObjectId", fetch = FetchType.LAZY) + private List tblSpecimenOldList; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "botanicalObjectId", fetch = FetchType.LAZY) private List tblDerivativeList; public TblBotanicalObject() { @@ -307,6 +309,15 @@ public void setTblIndexSeminumContentList(List tblIndexS this.tblIndexSeminumContentList = tblIndexSeminumContentList; } + @XmlTransient + public List getTblSpecimenOldList() { + return tblSpecimenOldList; + } + + public void setTblSpecimenOldList(List tblSpecimenOldList) { + this.tblSpecimenOldList = tblSpecimenOldList; + } + @XmlTransient public List getTblDerivativeList() { return tblDerivativeList; diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificate.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificate.java index 6a0416f..c6a3ae8 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificate.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificate.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificateType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificateType.java index 1a54512..9055748 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificateType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCertificateType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassification.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassification.java index 132a84f..df447b9 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassification.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassification.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassificationChorolStatus.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassificationChorolStatus.java index 4c307c4..46fbe5e 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassificationChorolStatus.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblClassificationChorolStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCultivar.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCultivar.java index 65c9ba1..59cc3af 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCultivar.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblCultivar.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivative.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivative.java index e8172a0..bc5f666 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivative.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivative.java @@ -26,8 +26,6 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; @@ -66,9 +64,11 @@ public class TblDerivative implements Serializable { @NotNull @Column(name = "price") private float price; - @ManyToMany(mappedBy = "tblDerivativeList", fetch = FetchType.LAZY) - private List tblSeedOrderList; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "derivativeId", fetch = FetchType.LAZY, orphanRemoval = true) + @OneToMany(cascade = CascadeType.ALL, mappedBy = "derivativeId", fetch = FetchType.LAZY) + private List tblSeedOrderDerivativeList; + @OneToOne(cascade = CascadeType.ALL, mappedBy = "tblDerivative", fetch = FetchType.LAZY) + private TblSpecimen tblSpecimen; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "derivativeId", fetch = FetchType.LAZY) private List tblSeparationList; @OneToOne(cascade = CascadeType.ALL, mappedBy = "tblDerivative", fetch = FetchType.LAZY) private TblSeed tblSeed; @@ -131,12 +131,20 @@ public void setPrice(float price) { } @XmlTransient - public List getTblSeedOrderList() { - return tblSeedOrderList; + public List getTblSeedOrderDerivativeList() { + return tblSeedOrderDerivativeList; + } + + public void setTblSeedOrderDerivativeList(List tblSeedOrderDerivativeList) { + this.tblSeedOrderDerivativeList = tblSeedOrderDerivativeList; + } + + public TblSpecimen getTblSpecimen() { + return tblSpecimen; } - public void setTblSeedOrderList(List tblSeedOrderList) { - this.tblSeedOrderList = tblSeedOrderList; + public void setTblSpecimen(TblSpecimen tblSpecimen) { + this.tblSpecimen = tblSpecimen; } @XmlTransient diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivativeType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivativeType.java index 9a18eae..18dfc5a 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivativeType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDerivativeType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiaspora.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiaspora.java index 886e42a..81b80ce 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiaspora.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiaspora.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiasporaBank.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiasporaBank.java index 296dc1c..36bacc9 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiasporaBank.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblDiasporaBank.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoNation.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoNation.java index 3d43ef6..554d59c 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoNation.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoNation.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoProvince.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoProvince.java index 2b46343..7e7acb7 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoProvince.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblGeoProvince.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblHabitusType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblHabitusType.java index 6df3c1e..0a0a663 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblHabitusType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblHabitusType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIdentStatus.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIdentStatus.java index f7ed426..74ae81c 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIdentStatus.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIdentStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImageServer.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImageServer.java index 434ad43..39776d5 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImageServer.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImageServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportError.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportError.java index 595122b..ea440a7 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportError.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportError.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportProperties.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportProperties.java index be37e21..aec063e 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportProperties.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblImportProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumContent.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumContent.java index d013ad3..d30b8f0 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumContent.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumPerson.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumPerson.java index b5296f1..a0c8999 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumPerson.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumPerson.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumRevision.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumRevision.java index 1529cc8..2b46450 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumRevision.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumRevision.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumType.java index 77f1ffc..a6bbcf4 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblIndexSeminumType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import java.io.Serializable; import java.util.List; import javax.persistence.Basic; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -57,6 +58,8 @@ public class TblIndexSeminumType implements Serializable { @Size(min = 1, max = 3) @Column(name = "type") private String type; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "indexSeminumTypeId", fetch = FetchType.LAZY) + private List tblSeedList; @OneToMany(mappedBy = "indexSeminumTypeId", fetch = FetchType.LAZY) private List tblLivingPlantList; @@ -88,6 +91,15 @@ public void setType(String type) { this.type = type; } + @XmlTransient + public List getTblSeedList() { + return tblSeedList; + } + + public void setTblSeedList(List tblSeedList) { + this.tblSeedList = tblSeedList; + } + @XmlTransient public List getTblLivingPlantList() { return tblLivingPlantList; diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventory.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventory.java index 34b82e9..cd48e5a 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventory.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryObject.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryObject.java index d8a7c1e..c4ee37f 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryObject.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryType.java index f90ae87..9366930 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblInventoryType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLabelType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLabelType.java index 2c9c173..055115e 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLabelType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLabelType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLivingPlantTreeRecordFilePage.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLivingPlantTreeRecordFilePage.java index a758d54..dcc9700 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLivingPlantTreeRecordFilePage.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLivingPlantTreeRecordFilePage.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocation.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocation.java index 9cf72dd..9df82b0 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocation.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationCoordinates.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationCoordinates.java index fa8280d..6838383 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationCoordinates.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationCoordinates.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationGeonames.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationGeonames.java index 201978c..a7c66ed 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationGeonames.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblLocationGeonames.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPerson.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPerson.java index 672a5fb..70b6747 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPerson.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPerson.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPhenology.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPhenology.java index be4c73f..8a8a67e 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPhenology.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblPhenology.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblRelevancyType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblRelevancyType.java index 176f30a..2592969 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblRelevancyType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblRelevancyType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblScientificNameInformation.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblScientificNameInformation.java index a1817e8..54f396f 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblScientificNameInformation.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblScientificNameInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,6 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.Lob; @@ -32,6 +30,7 @@ import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; @@ -51,6 +50,7 @@ public class TblScientificNameInformation implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) + @NotNull @Column(name = "scientific_name_id") private Long scientificNameId; @Lob @@ -64,7 +64,7 @@ public class TblScientificNameInformation implements Serializable { @JoinColumn(name = "habitus_type_id", referencedColumnName = "habitus_type_id") @ManyToOne(fetch = FetchType.LAZY) private TblHabitusType habitusTypeId; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "scientificNameId", fetch = FetchType.LAZY, orphanRemoval = true) + @OneToMany(cascade = CascadeType.ALL, mappedBy = "scientificNameId", fetch = FetchType.LAZY) private List tblCultivarList; public TblScientificNameInformation() { diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrder.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrder.java index 87f81cb..29b2060 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrder.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrder.java @@ -19,6 +19,7 @@ import java.util.Date; import java.util.List; import javax.persistence.Basic; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -32,6 +33,7 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -73,11 +75,8 @@ public class TblSeedOrder implements Serializable { @NotNull @Column(name = "complete") private boolean complete; - @JoinTable(name = "tbl_seed_order_derivative", joinColumns = { - @JoinColumn(name = "seed_order_id", referencedColumnName = "seed_order_id")}, inverseJoinColumns = { - @JoinColumn(name = "derivative_id", referencedColumnName = "derivative_id")}) - @ManyToMany(fetch = FetchType.LAZY) - private List tblDerivativeList; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "seedOrderId", fetch = FetchType.LAZY) + private List tblSeedOrderDerivativeList; @JoinColumn(name = "sender_user_id", referencedColumnName = "id") @ManyToOne(optional = false, fetch = FetchType.LAZY) private FrmwrkUser senderUserId; @@ -134,12 +133,12 @@ public void setComplete(boolean complete) { } @XmlTransient - public List getTblDerivativeList() { - return tblDerivativeList; + public List getTblSeedOrderDerivativeList() { + return tblSeedOrderDerivativeList; } - public void setTblDerivativeList(List tblDerivativeList) { - this.tblDerivativeList = tblDerivativeList; + public void setTblSeedOrderDerivativeList(List tblSeedOrderDerivativeList) { + this.tblSeedOrderDerivativeList = tblSeedOrderDerivativeList; } public FrmwrkUser getSenderUserId() { diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrderDerivative.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrderDerivative.java new file mode 100644 index 0000000..baa7d35 --- /dev/null +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeedOrderDerivative.java @@ -0,0 +1,114 @@ +/* + * Copyright 2019 wkoller. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jacq.common.model.jpa; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author wkoller + */ +@Entity +@Table(name = "tbl_seed_order_derivative") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "TblSeedOrderDerivative.findAll", query = "SELECT t FROM TblSeedOrderDerivative t") + , @NamedQuery(name = "TblSeedOrderDerivative.findBySeedOrderDerivativeId", query = "SELECT t FROM TblSeedOrderDerivative t WHERE t.seedOrderDerivativeId = :seedOrderDerivativeId")}) +public class TblSeedOrderDerivative implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "seed_order_derivative_id") + private Long seedOrderDerivativeId; + @JoinColumn(name = "derivative_id", referencedColumnName = "derivative_id") + @ManyToOne(optional = false, fetch = FetchType.LAZY) + private TblDerivative derivativeId; + @JoinColumn(name = "seed_order_id", referencedColumnName = "seed_order_id") + @ManyToOne(optional = false, fetch = FetchType.LAZY) + private TblSeedOrder seedOrderId; + + public TblSeedOrderDerivative() { + } + + public TblSeedOrderDerivative(Long seedOrderDerivativeId) { + this.seedOrderDerivativeId = seedOrderDerivativeId; + } + + public Long getSeedOrderDerivativeId() { + return seedOrderDerivativeId; + } + + public void setSeedOrderDerivativeId(Long seedOrderDerivativeId) { + this.seedOrderDerivativeId = seedOrderDerivativeId; + } + + public TblDerivative getDerivativeId() { + return derivativeId; + } + + public void setDerivativeId(TblDerivative derivativeId) { + this.derivativeId = derivativeId; + } + + public TblSeedOrder getSeedOrderId() { + return seedOrderId; + } + + public void setSeedOrderId(TblSeedOrder seedOrderId) { + this.seedOrderId = seedOrderId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (seedOrderDerivativeId != null ? seedOrderDerivativeId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TblSeedOrderDerivative)) { + return false; + } + TblSeedOrderDerivative other = (TblSeedOrderDerivative) object; + if ((this.seedOrderDerivativeId == null && other.seedOrderDerivativeId != null) || (this.seedOrderDerivativeId != null && !this.seedOrderDerivativeId.equals(other.seedOrderDerivativeId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "org.jacq.common.model.jpa.TblSeedOrderDerivative[ seedOrderDerivativeId=" + seedOrderDerivativeId + " ]"; + } + +} diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparation.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparation.java index dc7a568..305a420 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparation.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparation.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparationType.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparationType.java index 9d8b5c8..a8d1347 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparationType.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSeparationType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSequence.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSequence.java index 25ba293..c700777 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSequence.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSex.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSex.java index d419ea7..3cb1762 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSex.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSex.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimen.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimen.java index e947571..719ef0f 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimen.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimen.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 fhafner. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ /** * - * @author fhafner + * @author wkoller */ @Entity @Table(name = "tbl_specimen") @@ -47,6 +47,7 @@ public class TblSpecimen implements Serializable { private static final long serialVersionUID = 1L; @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "specimen_id") private Long specimenId; diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimenOld.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimenOld.java new file mode 100644 index 0000000..f2c41d1 --- /dev/null +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblSpecimenOld.java @@ -0,0 +1,142 @@ +/* + * Copyright 2019 wkoller. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jacq.common.model.jpa; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author wkoller + */ +@Entity +@Table(name = "tbl_specimen_old") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "TblSpecimenOld.findAll", query = "SELECT t FROM TblSpecimenOld t") + , @NamedQuery(name = "TblSpecimenOld.findBySpecimenId", query = "SELECT t FROM TblSpecimenOld t WHERE t.specimenId = :specimenId") + , @NamedQuery(name = "TblSpecimenOld.findByHerbarNumber", query = "SELECT t FROM TblSpecimenOld t WHERE t.herbarNumber = :herbarNumber") + , @NamedQuery(name = "TblSpecimenOld.findByTimestamp", query = "SELECT t FROM TblSpecimenOld t WHERE t.timestamp = :timestamp")}) +public class TblSpecimenOld implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "specimen_id") + private Long specimenId; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 20) + @Column(name = "herbar_number") + private String herbarNumber; + @Basic(optional = false) + @NotNull + @Column(name = "timestamp", insertable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date timestamp; + @JoinColumn(name = "botanical_object_id", referencedColumnName = "id") + @ManyToOne(optional = false, fetch = FetchType.LAZY) + private TblBotanicalObject botanicalObjectId; + + public TblSpecimenOld() { + } + + public TblSpecimenOld(Long specimenId) { + this.specimenId = specimenId; + } + + public TblSpecimenOld(Long specimenId, String herbarNumber, Date timestamp) { + this.specimenId = specimenId; + this.herbarNumber = herbarNumber; + this.timestamp = timestamp; + } + + public Long getSpecimenId() { + return specimenId; + } + + public void setSpecimenId(Long specimenId) { + this.specimenId = specimenId; + } + + public String getHerbarNumber() { + return herbarNumber; + } + + public void setHerbarNumber(String herbarNumber) { + this.herbarNumber = herbarNumber; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public TblBotanicalObject getBotanicalObjectId() { + return botanicalObjectId; + } + + public void setBotanicalObjectId(TblBotanicalObject botanicalObjectId) { + this.botanicalObjectId = botanicalObjectId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (specimenId != null ? specimenId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof TblSpecimenOld)) { + return false; + } + TblSpecimenOld other = (TblSpecimenOld) object; + if ((this.specimenId == null && other.specimenId != null) || (this.specimenId != null && !this.specimenId.equals(other.specimenId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "org.jacq.common.model.jpa.TblSpecimenOld[ specimenId=" + specimenId + " ]"; + } + +} diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFile.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFile.java index 9222f7e..2c7666e 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFile.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.jacq.common.model.jpa; import java.io.Serializable; -import java.util.Date; import java.util.List; import javax.persistence.Basic; import javax.persistence.CascadeType; @@ -30,8 +29,6 @@ import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFilePage.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFilePage.java index 8faea7d..7d58923 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFilePage.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblTreeRecordFilePage.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblUserClassificationSource.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblUserClassificationSource.java index eac4757..5022f2b 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblUserClassificationSource.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblUserClassificationSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblVegetative.java b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblVegetative.java index 4a02c5d..2f0be1b 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/jpa/TblVegetative.java +++ b/jacq-common/src/main/java/org/jacq/common/model/jpa/TblVegetative.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 wkoller. + * Copyright 2019 wkoller. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jacq-common/src/main/java/org/jacq/common/model/rest/BotanicalObjectDownloadResult.java b/jacq-common/src/main/java/org/jacq/common/model/rest/BotanicalObjectDownloadResult.java index bef4ac4..a45436c 100644 --- a/jacq-common/src/main/java/org/jacq/common/model/rest/BotanicalObjectDownloadResult.java +++ b/jacq-common/src/main/java/org/jacq/common/model/rest/BotanicalObjectDownloadResult.java @@ -55,6 +55,8 @@ public class BotanicalObjectDownloadResult extends BotanicalObjectDerivative { protected String familyNoAuthor; protected String familyReference; protected String indexSeminumType; + protected long count; + protected float price; public BotanicalObjectDownloadResult() { } @@ -148,6 +150,9 @@ public BotanicalObjectDownloadResult(BotanicalObjectDerivative botanicalObjectDe this.setPerson(this.getPerson().replaceAll(", $", "")); } + // count & price + this.setCount(derivative.getCount()); + this.setPrice(derivative.getPrice()); } public String getFamilyReference() { @@ -310,4 +315,19 @@ public void setIndexSeminumType(String indexSeminumType) { this.indexSeminumType = indexSeminumType; } + public long getCount() { + return count; + } + + public void setCount(long count) { + this.count = count; + } + + public float getPrice() { + return price; + } + + public void setPrice(float price) { + this.price = price; + } } diff --git a/jacq-dataimport/pom.xml b/jacq-dataimport/pom.xml index aee9e14..696ac3c 100644 --- a/jacq-dataimport/pom.xml +++ b/jacq-dataimport/pom.xml @@ -4,7 +4,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-dataimport/src/main/resources/META-INF/persistence.xml b/jacq-dataimport/src/main/resources/META-INF/persistence.xml index 6993385..b1325b7 100644 --- a/jacq-dataimport/src/main/resources/META-INF/persistence.xml +++ b/jacq-dataimport/src/main/resources/META-INF/persistence.xml @@ -4,7 +4,7 @@ java:/jacqDS org.hibernate.ejb.HibernatePersistence - ../WEB-INF/lib/jacq-common-0.8.0.jar + ../WEB-INF/lib/jacq-common-0.9.0.jar false diff --git a/jacq-input/pom.xml b/jacq-input/pom.xml index 3f25414..f14080d 100644 --- a/jacq-input/pom.xml +++ b/jacq-input/pom.xml @@ -4,7 +4,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-input/src/main/java/org/jacq/input/controller/LivingPlantEditController.java b/jacq-input/src/main/java/org/jacq/input/controller/LivingPlantEditController.java index 9d5f06e..a101b8c 100644 --- a/jacq-input/src/main/java/org/jacq/input/controller/LivingPlantEditController.java +++ b/jacq-input/src/main/java/org/jacq/input/controller/LivingPlantEditController.java @@ -180,9 +180,6 @@ public void init() { this.livingPlantResult = new LivingPlantResult(); - // setup default values - this.livingPlantResult.setIpenType("default"); - if (sessionManager.getUser() != null) { livingPlantResult.setOrganisation(this.organisationService.load(sessionManager.getUser().getOrganisationId())); } @@ -211,10 +208,17 @@ public void init() { this.labelTypes.add(new SelectItem(labelType.getLabelTypeId(), labelType.getType())); } this.selectedLabelTypes = new ArrayList<>(); - this.showorganisationHierarchicSelectController(); - this.cultivarResult = new CultivarResult(); + + // setup default values + this.livingPlantResult.setIpenType("default"); + for (IndexSeminumTypeResult indexSeminumType : this.indexSeminumTypes) { + if (indexSeminumType.getType().equals("WS")) { + this.livingPlantResult.setIndexSeminumType(indexSeminumType); + break; + } + } } /** diff --git a/jacq-input/src/main/java/org/jacq/input/controller/SeedExchangeController.java b/jacq-input/src/main/java/org/jacq/input/controller/SeedExchangeController.java index 1f22a33..4df52e0 100644 --- a/jacq-input/src/main/java/org/jacq/input/controller/SeedExchangeController.java +++ b/jacq-input/src/main/java/org/jacq/input/controller/SeedExchangeController.java @@ -5,6 +5,7 @@ */ package org.jacq.input.controller; +import java.io.Serializable; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; @@ -19,7 +20,7 @@ */ @ViewScoped @ManagedBean -public class SeedExchangeController { +public class SeedExchangeController implements Serializable { protected SeedExchangeService seedExchangeService; diff --git a/jacq-input/src/main/java/org/jacq/input/controller/SessionController.java b/jacq-input/src/main/java/org/jacq/input/controller/SessionController.java index a304b44..2be68ea 100644 --- a/jacq-input/src/main/java/org/jacq/input/controller/SessionController.java +++ b/jacq-input/src/main/java/org/jacq/input/controller/SessionController.java @@ -15,6 +15,7 @@ */ package org.jacq.input.controller; +import java.io.Serializable; import java.util.ResourceBundle; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; @@ -33,7 +34,7 @@ */ @ManagedBean @SessionScoped -public class SessionController { +public class SessionController implements Serializable { @Inject protected SessionManager sessionManager; diff --git a/jacq-input/src/main/webapp/pages/livingplant/edit.xhtml b/jacq-input/src/main/webapp/pages/livingplant/edit.xhtml index 2004edb..573b621 100644 --- a/jacq-input/src/main/webapp/pages/livingplant/edit.xhtml +++ b/jacq-input/src/main/webapp/pages/livingplant/edit.xhtml @@ -469,7 +469,7 @@
+ var="location" itemLabel="#{location.location}" itemValue="#{location}" minQueryLength="3" queryDelay="500" converter="locationConverter"> @@ -557,7 +557,7 @@
- +
diff --git a/jacq-input/src/main/webapp/pages/livingplant/manage.xhtml b/jacq-input/src/main/webapp/pages/livingplant/manage.xhtml index e90d376..54f5e2a 100644 --- a/jacq-input/src/main/webapp/pages/livingplant/manage.xhtml +++ b/jacq-input/src/main/webapp/pages/livingplant/manage.xhtml @@ -369,6 +369,14 @@ + + + + + + + + diff --git a/jacq-input/src/main/webapp/pages/seedexchange/edit.xhtml b/jacq-input/src/main/webapp/pages/seedexchange/edit.xhtml index 50661da..cdd1fd1 100644 --- a/jacq-input/src/main/webapp/pages/seedexchange/edit.xhtml +++ b/jacq-input/src/main/webapp/pages/seedexchange/edit.xhtml @@ -72,7 +72,7 @@
- +
@@ -104,7 +104,8 @@
- + +
@@ -206,6 +207,10 @@ + + + + diff --git a/jacq-input/src/test/java/org/jacq/input/EditTest.java b/jacq-input/src/test/java/org/jacq/input/EditTest.java index de1d956..1297344 100644 --- a/jacq-input/src/test/java/org/jacq/input/EditTest.java +++ b/jacq-input/src/test/java/org/jacq/input/EditTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; /** * @@ -57,6 +58,11 @@ public void createLiving() { List scientificNameRows = scientificNamePanel.findElements(By.tagName("tr")); Assert.assertTrue(scientificNameRows.size() > 0); scientificNameRows.get(0).click(); + + // check index seminum type for "WS" as default value + WebElement indexSeminumTypeSelect = driver.findElement(By.id("jacq_form:tabView:index_seminum_type_input")); + Assert.assertNotNull(indexSeminumTypeSelect); + Assert.assertEquals("WS", (new Select(indexSeminumTypeSelect)).getFirstSelectedOption().getText()); } @Test diff --git a/jacq-names/pom.xml b/jacq-names/pom.xml index b53fddc..3003625 100644 --- a/jacq-names/pom.xml +++ b/jacq-names/pom.xml @@ -4,7 +4,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-names/src/main/resources/META-INF/persistence.xml b/jacq-names/src/main/resources/META-INF/persistence.xml index b775270..a47b1f7 100644 --- a/jacq-names/src/main/resources/META-INF/persistence.xml +++ b/jacq-names/src/main/resources/META-INF/persistence.xml @@ -4,7 +4,7 @@ java:/openupDS org.hibernate.ejb.HibernatePersistence - ../WEB-INF/lib/jacq-common-0.8.0.jar + ../WEB-INF/lib/jacq-common-0.9.0.jar false @@ -22,7 +22,7 @@ java:/jacqDS org.hibernate.ejb.HibernatePersistence - ../WEB-INF/lib/jacq-common-0.8.0.jar + ../WEB-INF/lib/jacq-common-0.9.0.jar false diff --git a/jacq-output/pom.xml b/jacq-output/pom.xml index e969b28..520b655 100644 --- a/jacq-output/pom.xml +++ b/jacq-output/pom.xml @@ -4,7 +4,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-service-output/pom.xml b/jacq-service-output/pom.xml index c65b6b8..dc08084 100644 --- a/jacq-service-output/pom.xml +++ b/jacq-service-output/pom.xml @@ -4,7 +4,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-service-output/src/main/resources/META-INF/persistence.xml b/jacq-service-output/src/main/resources/META-INF/persistence.xml index 271f1e6..9141107 100644 --- a/jacq-service-output/src/main/resources/META-INF/persistence.xml +++ b/jacq-service-output/src/main/resources/META-INF/persistence.xml @@ -4,7 +4,7 @@ java:/jacqDS org.hibernate.ejb.HibernatePersistence - ../WEB-INF/lib/jacq-common-0.8.0.jar + ../WEB-INF/lib/jacq-common-0.9.0.jar false diff --git a/jacq-service-report/pom.xml b/jacq-service-report/pom.xml index 81598ac..6a0a5b0 100644 --- a/jacq-service-report/pom.xml +++ b/jacq-service-report/pom.xml @@ -4,7 +4,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-service-report/src/main/resources/META-INF/persistence.xml b/jacq-service-report/src/main/resources/META-INF/persistence.xml index 960b7e8..e0122c0 100644 --- a/jacq-service-report/src/main/resources/META-INF/persistence.xml +++ b/jacq-service-report/src/main/resources/META-INF/persistence.xml @@ -4,7 +4,7 @@ java:/jacqDS org.hibernate.ejb.HibernatePersistence - ../WEB-INF/lib/jacq-common-0.8.0.jar + ../WEB-INF/lib/jacq-common-0.9.0.jar false diff --git a/jacq-service/pom.xml b/jacq-service/pom.xml index a41c175..1e0885e 100644 --- a/jacq-service/pom.xml +++ b/jacq-service/pom.xml @@ -3,7 +3,7 @@ org.jacq jacq - 0.8.0 + 0.9.0 ../jacq/pom.xml diff --git a/jacq-service/src/main/java/org/jacq/service/manager/SeedExchangeManager.java b/jacq-service/src/main/java/org/jacq/service/manager/SeedExchangeManager.java index 4bbfb90..328b439 100644 --- a/jacq-service/src/main/java/org/jacq/service/manager/SeedExchangeManager.java +++ b/jacq-service/src/main/java/org/jacq/service/manager/SeedExchangeManager.java @@ -18,6 +18,7 @@ import org.jacq.common.model.jpa.TblDerivative; import org.jacq.common.model.jpa.TblOrganisation; import org.jacq.common.model.jpa.TblSeedOrder; +import org.jacq.common.model.jpa.TblSeedOrderDerivative; import org.jacq.common.model.jpa.custom.BotanicalObjectDerivative; import org.jacq.common.model.rest.SeedOrderResult; import org.jacq.common.rest.SeedExchangeService; @@ -45,7 +46,7 @@ public class SeedExchangeManager { public SeedOrderResult find(Long seedOrderId) { TblSeedOrder tblSeedOrder = em.find(TblSeedOrder.class, seedOrderId); - return new SeedOrderResult(tblSeedOrder, this.fromTblDerivativeList(tblSeedOrder.getTblDerivativeList())); + return new SeedOrderResult(tblSeedOrder, this.fromTblDerivativeList(tblSeedOrder.getTblSeedOrderDerivativeList())); } /** @@ -60,7 +61,7 @@ public List findAll() { List tblSeedOrderList = tblSeedOrderQuery.getResultList(); for (TblSeedOrder tblSeedOrder : tblSeedOrderList) { - seedOrderResults.add(new SeedOrderResult(tblSeedOrder, this.fromTblDerivativeList(tblSeedOrder.getTblDerivativeList()))); + seedOrderResults.add(new SeedOrderResult(tblSeedOrder, this.fromTblDerivativeList(tblSeedOrder.getTblSeedOrderDerivativeList()))); } return seedOrderResults; @@ -90,10 +91,13 @@ public SeedOrderResult save(SeedOrderResult seedOrderResult) { tblSeedOrder.setSenderOrganisationId(frmwrkUser.getOrganisationId()); tblSeedOrder.setSenderUserId(frmwrkUser); + // save & refresh seed order + em.persist(tblSeedOrder); + // add list of derivatives - List tblDerivatives = tblSeedOrder.getTblDerivativeList(); - if (tblDerivatives == null) { - tblDerivatives = new ArrayList<>(); + List tblSeedOrderDerivatives = tblSeedOrder.getTblSeedOrderDerivativeList(); + if (tblSeedOrderDerivatives == null) { + tblSeedOrderDerivatives = new ArrayList<>(); } for (BotanicalObjectDerivative botanicalObjectDerivative : seedOrderResult.getDerivativeList()) { TblDerivative tblDerivative = em.find(TblDerivative.class, botanicalObjectDerivative.getDerivativeId()); @@ -110,29 +114,34 @@ public SeedOrderResult save(SeedOrderResult seedOrderResult) { em.persist(tblDerivative); } - tblDerivatives.add(tblDerivative); + TblSeedOrderDerivative tblSeedOrderDerivative = new TblSeedOrderDerivative(); + tblSeedOrderDerivative.setDerivativeId(tblDerivative); + tblSeedOrderDerivative.setSeedOrderId(tblSeedOrder); + + // persist derivative association and save it + em.persist(tblSeedOrderDerivative); + em.flush(); + em.refresh(tblSeedOrderDerivative); } - tblSeedOrder.setTblDerivativeList(tblDerivatives); - // save & refresh seed order - em.persist(tblSeedOrder); + // refresh seed order em.flush(); em.refresh(tblSeedOrder); - return new SeedOrderResult(tblSeedOrder, this.fromTblDerivativeList(tblSeedOrder.getTblDerivativeList())); + return new SeedOrderResult(tblSeedOrder, this.fromTblDerivativeList(tblSeedOrder.getTblSeedOrderDerivativeList())); } /** * Helper function for converting a list of tblderivatives to * botanicalobject derivatives * - * @param tblDerivatives + * @param tblSeedOrderDerivatives * @return */ - protected List fromTblDerivativeList(List tblDerivatives) { + protected List fromTblDerivativeList(List tblSeedOrderDerivatives) { List botanicalObjectDerivatives = new ArrayList<>(); - for (TblDerivative tblDerivative : tblDerivatives) { - List botanicalObjectDerivativeResults = derivativeManager.find(null, tblDerivative.getDerivativeId(), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + for (TblSeedOrderDerivative tblSeedOrderDerivative : tblSeedOrderDerivatives) { + List botanicalObjectDerivativeResults = derivativeManager.find(null, tblSeedOrderDerivative.getDerivativeId().getDerivativeId(), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); if (botanicalObjectDerivativeResults != null && botanicalObjectDerivativeResults.size() > 0) { botanicalObjectDerivatives.add(botanicalObjectDerivativeResults.get(0)); } diff --git a/jacq-service/src/main/resources/META-INF/persistence.xml b/jacq-service/src/main/resources/META-INF/persistence.xml index 6993385..b1325b7 100644 --- a/jacq-service/src/main/resources/META-INF/persistence.xml +++ b/jacq-service/src/main/resources/META-INF/persistence.xml @@ -4,7 +4,7 @@ java:/jacqDS org.hibernate.ejb.HibernatePersistence - ../WEB-INF/lib/jacq-common-0.8.0.jar + ../WEB-INF/lib/jacq-common-0.9.0.jar false diff --git a/jacq/jacq.mwb b/jacq/jacq.mwb index 607bea3..c0e9e39 100644 Binary files a/jacq/jacq.mwb and b/jacq/jacq.mwb differ diff --git a/jacq/pom.xml b/jacq/pom.xml index b1c28dd..13034e5 100644 --- a/jacq/pom.xml +++ b/jacq/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.jacq jacq - 0.8.0 + 0.9.0 jacq pom