From a82c6bbe518fb27c576d97c77d1b6bb6157e9683 Mon Sep 17 00:00:00 2001 From: speckij Date: Tue, 28 Jul 2026 17:18:34 +0200 Subject: [PATCH 1/3] [WIP] Hibernate 6 Migration --- .github/workflows/daily.yml | 4 +- .github/workflows/push.yml | 2 +- .github/workflows/push_java_8.yml | 2 +- dialects/pom.xml | 31 -- .../TimestampWithTimeZoneGeoDBDialect.java | 30 -- .../mysql/TimestampMySQL57SpatialDialect.java | 53 --- .../mysql/TimestampMySQL8SpatialDialect.java | 53 --- ...mpWithTimeZoneOracleSpatial10gDialect.java | 32 -- ...mestampWithTimeZonePostgisPG95Dialect.java | 31 -- ...thTimeZoneSqlServer2008SpatialDialect.java | 31 -- ...thTimeZoneSqlServer2012SpatialDialect.java | 31 -- entities/pom.xml | 15 +- .../db/beans/AbstractDatasetEntity.java | 2 + .../db/beans/AbstractFeatureEntity.java | 6 +- .../db/beans/AbstractRelationEntity.java | 3 + .../series/db/beans/AssessmentTypeEntity.java | 2 + .../n52/series/db/beans/BlobDataEntity.java | 2 + .../series/db/beans/BooleanDataEntity.java | 2 + .../series/db/beans/CategoryDataEntity.java | 2 + .../n52/series/db/beans/CategoryEntity.java | 3 + .../n52/series/db/beans/CodespaceEntity.java | 2 + .../series/db/beans/ComplexDataEntity.java | 2 + .../series/db/beans/CompositeDataEntity.java | 2 + .../n52/series/db/beans/CountDataEntity.java | 2 + .../series/db/beans/DataArrayDataEntity.java | 2 + .../org/n52/series/db/beans/DataEntity.java | 2 + .../db/beans/DatasetAggregationEntity.java | 6 +- .../n52/series/db/beans/DatasetEntity.java | 2 + .../series/db/beans/DescribableEntity.java | 2 + .../n52/series/db/beans/FeatureEntity.java | 3 + .../org/n52/series/db/beans/FormatEntity.java | 3 + .../series/db/beans/GeometryDataEntity.java | 2 + .../n52/series/db/beans/GeometryEntity.java | 2 + .../series/db/beans/HierarchicalEntity.java | 2 + .../org/n52/series/db/beans/IdEntity.java | 2 + .../n52/series/db/beans/NetworkEntity.java | 3 + .../n52/series/db/beans/OfferingEntity.java | 2 + .../n52/series/db/beans/PhenomenonEntity.java | 2 + .../n52/series/db/beans/PlatformEntity.java | 2 + .../n52/series/db/beans/ProcedureEntity.java | 2 + .../db/beans/ProcedureHistoryEntity.java | 2 + .../series/db/beans/ProfileDataEntity.java | 2 + .../series/db/beans/QuantityDataEntity.java | 2 + .../n52/series/db/beans/RecordDataEntity.java | 2 + .../series/db/beans/ReferencedDataEntity.java | 2 + .../series/db/beans/RelatedDataEntity.java | 3 + .../series/db/beans/RelatedDatasetEntity.java | 3 + .../series/db/beans/RelatedFeatureEntity.java | 2 + .../series/db/beans/ResultTemplateEntity.java | 2 + .../db/beans/SamplingGeometryEntity.java | 2 + .../series/db/beans/SensorML20DataEntity.java | 2 + .../n52/series/db/beans/ServiceEntity.java | 10 +- .../db/beans/ServiceMetadataEntity.java | 2 + .../org/n52/series/db/beans/TagEntity.java | 2 + .../n52/series/db/beans/TextDataEntity.java | 2 + .../series/db/beans/TrajectoryDataEntity.java | 2 + .../org/n52/series/db/beans/UnitEntity.java | 3 + .../db/beans/VerticalMetadataEntity.java | 2 + .../ereporting/EReportingQualityEntity.java | 2 + .../feature/AbstractMonitoringFeature.java | 2 + .../db/beans/feature/NilReasonEntity.java | 3 + .../db/beans/feature/ReferenceEntity.java | 3 + .../db/beans/feature/SpecimenEntity.java | 2 + .../beans/feature/gmd/AbstractCiEntity.java | 3 + .../db/beans/feature/gmd/AddressEntity.java | 2 + .../db/beans/feature/gmd/ContactEntity.java | 3 + .../db/beans/feature/gmd/ExExtentEntity.java | 2 + .../feature/gmd/ExVerticalExtentEntity.java | 3 + .../feature/gmd/OnlineResourceEntity.java | 3 + .../feature/gmd/ResponsiblePartyEntity.java | 3 + .../db/beans/feature/gmd/RoleEntity.java | 3 + .../db/beans/feature/gmd/TelephoneEntity.java | 2 + .../gml/CoordinateSystemAxisEntity.java | 3 + .../feature/gml/DomainOfValidityEntity.java | 3 + .../beans/feature/gml/VerticalCRSEntity.java | 2 + .../beans/feature/gml/VerticalCSEntity.java | 2 + .../feature/gml/VerticalDatumEntity.java | 2 + ...EnvironmentalMonitoringFacilityEntity.java | 3 + .../beans/feature/inspire/MediaMonitored.java | 2 + .../feature/wml/MonitoringPointEntity.java | 3 + .../db/beans/i18n/AbstractI18nEntity.java | 2 + .../db/beans/i18n/I18nCategoryEntity.java | 3 + .../series/db/beans/i18n/I18nDataEntity.java | 3 + .../db/beans/i18n/I18nDatasetEntity.java | 3 + .../n52/series/db/beans/i18n/I18nEntity.java | 3 + .../db/beans/i18n/I18nFeatureEntity.java | 3 + .../series/db/beans/i18n/I18nGroupEntity.java | 3 + .../db/beans/i18n/I18nLicenseEntity.java | 3 + .../db/beans/i18n/I18nLocationEntity.java | 3 + .../i18n/I18nMeasuringProgramEntity.java | 3 + .../db/beans/i18n/I18nOfferingEntity.java | 3 + .../series/db/beans/i18n/I18nPartyEntity.java | 3 + .../db/beans/i18n/I18nPhenomenonEntity.java | 3 + .../db/beans/i18n/I18nPlatformEntity.java | 3 + .../db/beans/i18n/I18nProcedureEntity.java | 3 + .../db/beans/i18n/I18nProfileDataEntity.java | 3 + .../db/beans/i18n/I18nProjectEntity.java | 3 + .../db/beans/i18n/I18nSamplingEntity.java | 3 + .../db/beans/i18n/I18nServiceEntity.java | 3 + .../series/db/beans/i18n/I18nTagEntity.java | 3 + .../series/db/beans/i18n/I18nUnitEntity.java | 3 + .../i18n/I18nVerticalMetadataEntity.java | 3 + .../db/beans/parameter/ParameterEntity.java | 2 + .../DatasetBooleanParameterEntity.java | 3 + .../DatasetCategoryParameterEntity.java | 2 + .../DatasetComplexParameterEntity.java | 2 + .../dataset/DatasetCountParameterEntity.java | 3 + .../dataset/DatasetJsonParameterEntity.java | 3 + .../dataset/DatasetParameterEntity.java | 3 + .../DatasetQuantityParameterEntity.java | 2 + .../DatasetTemporalParameterEntity.java | 3 + .../dataset/DatasetTextParameterEntity.java | 3 + .../dataset/DatasetXmlParameterEntity.java | 3 + .../FeatureBooleanParameterEntity.java | 3 + .../FeatureCategoryParameterEntity.java | 2 + .../FeatureComplexParameterEntity.java | 2 + .../feature/FeatureCountParameterEntity.java | 3 + .../feature/FeatureJsonParameterEntity.java | 3 + .../feature/FeatureParameterEntity.java | 3 + .../FeatureQuantityParameterEntity.java | 2 + .../FeatureTemporalParameterEntity.java | 3 + .../feature/FeatureTextParameterEntity.java | 3 + .../feature/FeatureXmlParameterEntity.java | 3 + .../group/GroupBooleanParameterEntity.java | 3 + .../group/GroupCategoryParameterEntity.java | 2 + .../group/GroupComplexParameterEntity.java | 2 + .../group/GroupCountParameterEntity.java | 3 + .../group/GroupJsonParameterEntity.java | 3 + .../parameter/group/GroupParameterEntity.java | 3 + .../group/GroupQuantityParameterEntity.java | 2 + .../group/GroupTemporalParameterEntity.java | 3 + .../group/GroupTextParameterEntity.java | 3 + .../group/GroupXmlParameterEntity.java | 3 + .../LicenseBooleanParameterEntity.java | 3 + .../LicenseCategoryParameterEntity.java | 2 + .../LicenseComplexParameterEntity.java | 2 + .../license/LicenseCountParameterEntity.java | 3 + .../license/LicenseJsonParameterEntity.java | 3 + .../license/LicenseParameterEntity.java | 3 + .../LicenseQuantityParameterEntity.java | 2 + .../LicenseTemporalParameterEntity.java | 3 + .../license/LicenseTextParameterEntity.java | 3 + .../license/LicenseXmlParameterEntity.java | 3 + .../LocationBooleanParameterEntity.java | 3 + .../LocationCategoryParameterEntity.java | 2 + .../LocationComplexParameterEntity.java | 2 + .../LocationCountParameterEntity.java | 3 + .../location/LocationJsonParameterEntity.java | 3 + .../location/LocationParameterEntity.java | 3 + .../LocationQuantityParameterEntity.java | 2 + .../LocationTemporalParameterEntity.java | 3 + .../location/LocationTextParameterEntity.java | 3 + .../location/LocationXmlParameterEntity.java | 3 + .../ObservationBooleanParameterEntity.java | 3 + .../ObservationCategoryParameterEntity.java | 2 + .../ObservationComplexParameterEntity.java | 2 + .../ObservationCountParameterEntity.java | 3 + .../ObservationJsonParameterEntity.java | 3 + .../ObservationParameterEntity.java | 3 + .../ObservationQuantityParameterEntity.java | 2 + .../ObservationTemporalParameterEntity.java | 3 + .../ObservationTextParameterEntity.java | 3 + .../ObservationXmlParameterEntity.java | 3 + .../party/PartyBooleanParameterEntity.java | 3 + .../party/PartyCategoryParameterEntity.java | 2 + .../party/PartyComplexParameterEntity.java | 2 + .../party/PartyCountParameterEntity.java | 3 + .../party/PartyJsonParameterEntity.java | 3 + .../parameter/party/PartyParameterEntity.java | 3 + .../party/PartyQuantityParameterEntity.java | 2 + .../party/PartyTemporalParameterEntity.java | 3 + .../party/PartyTextParameterEntity.java | 3 + .../party/PartyXmlParameterEntity.java | 3 + .../PhenomenonBooleanParameterEntity.java | 3 + .../PhenomenonCategoryParameterEntity.java | 2 + .../PhenomenonComplexParameterEntity.java | 2 + .../PhenomenonCountParameterEntity.java | 3 + .../PhenomenonJsonParameterEntity.java | 3 + .../phenomenon/PhenomenonParameterEntity.java | 3 + .../PhenomenonQuantityParameterEntity.java | 2 + .../PhenomenonTemporalParameterEntity.java | 3 + .../PhenomenonTextParameterEntity.java | 3 + .../PhenomenonXmlParameterEntity.java | 3 + .../PlatformBooleanParameterEntity.java | 3 + .../PlatformCategoryParameterEntity.java | 2 + .../PlatformComplexParameterEntity.java | 2 + .../PlatformCountParameterEntity.java | 3 + .../platform/PlatformJsonParameterEntity.java | 3 + .../platform/PlatformParameterEntity.java | 3 + .../PlatformQuantityParameterEntity.java | 2 + .../PlatformTemporalParameterEntity.java | 3 + .../platform/PlatformTextParameterEntity.java | 3 + .../platform/PlatformXmlParameterEntity.java | 3 + .../ProcedureBooleanParameterEntity.java | 3 + .../ProcedureCategoryParameterEntity.java | 2 + .../ProcedureComplexParameterEntity.java | 2 + .../ProcedureCountParameterEntity.java | 3 + .../ProcedureJsonParameterEntity.java | 3 + .../procedure/ProcedureParameterEntity.java | 3 + .../ProcedureQuantityParameterEntity.java | 2 + .../ProcedureTemporalParameterEntity.java | 3 + .../ProcedureTextParameterEntity.java | 3 + .../ProcedureXmlParameterEntity.java | 3 + .../ProjectBooleanParameterEntity.java | 3 + .../ProjectCategoryParameterEntity.java | 2 + .../ProjectComplexParameterEntity.java | 2 + .../project/ProjectCountParameterEntity.java | 3 + .../project/ProjectJsonParameterEntity.java | 3 + .../project/ProjectParameterEntity.java | 3 + .../ProjectQuantityParameterEntity.java | 2 + .../ProjectTemporalParameterEntity.java | 3 + .../project/ProjectTextParameterEntity.java | 3 + .../project/ProjectXmlParameterEntity.java | 3 + .../RelationBooleanParameterEntity.java | 3 + .../RelationCategoryParameterEntity.java | 2 + .../RelationComplexParameterEntity.java | 2 + .../RelationCountParameterEntity.java | 3 + .../relation/RelationJsonParameterEntity.java | 3 + .../relation/RelationParameterEntity.java | 3 + .../RelationQuantityParameterEntity.java | 2 + .../RelationTemporalParameterEntity.java | 3 + .../relation/RelationTextParameterEntity.java | 3 + .../relation/RelationXmlParameterEntity.java | 3 + .../db/beans/quality/QualityEntity.java | 3 + .../beans/quality/QuantityQualityEntity.java | 2 + .../db/beans/quality/TextQualityEntity.java | 3 + .../sampling/MeasuringProgramEntity.java | 2 + .../db/beans/sampling/SamplingEntity.java | 2 + .../SamplingProfileDatasetEntity.java | 2 + .../beans/sta/AbstractObservationEntity.java | 4 +- .../n52/series/db/beans/sta/GroupEntity.java | 2 + .../beans/sta/HistoricalLocationEntity.java | 2 + .../series/db/beans/sta/LicenseEntity.java | 2 + .../series/db/beans/sta/LocationEntity.java | 2 + .../n52/series/db/beans/sta/PartyEntity.java | 2 + .../series/db/beans/sta/ProjectEntity.java | 2 + .../series/db/beans/sta/RelationEntity.java | 2 + .../n52/series/db/common/LocaleHelper.java | 2 +- generator/pom.xml | 147 ------- ...mestampMySQL8SpatialDialectNoComments.java | 33 -- ...ampWithTimeZoneGeoDBDialectNoComments.java | 33 -- ...ZoneOracleSpatial10gDialectNoComments.java | 34 -- ...hTimeZonePostgisPG95DialectNoComments.java | 32 -- ...SqlServer2008SpatialDialectNoComments.java | 34 -- ...SqlServer2012SpatialDialectNoComments.java | 34 -- .../db/generator/AbstractGenerator.java | 408 ------------------ .../db/generator/SQLScriptGenerator.java | 219 ---------- .../db/generator/TableMetadataGenerator.java | 257 ----------- generator/src/main/resources/logback.xml | 16 - .../db/generator/SQLScriptGeneratorTest.java | 28 -- .../generator/TableMetadataGeneratorTest.java | 27 -- generator/src/test/resources/logback-test.xml | 16 - mappings/pom.xml | 10 + .../ereporting/core/FeatureResource.hbm.xml | 2 +- .../ereporting/core/LocationResource.hbm.xml | 2 +- .../ereporting/core/OfferingResource.hbm.xml | 2 +- .../ereporting/dataset/DataResource.hbm.xml | 14 +- .../dataset/DatasetResource.hbm.xml | 2 +- .../ereporting/sampling/DataResource.hbm.xml | 14 +- .../sampling/DatasetResource.hbm.xml | 2 +- .../ereporting/staplus/DataResource.hbm.xml | 14 +- .../staplus/DatasetResource.hbm.xml | 2 +- .../DatasetParameterResource.hbm.xml | 9 - .../FeatureParameterResource.hbm.xml | 9 - .../LocationParameterResource.hbm.xml | 6 - .../ObservationParameterResource.hbm.xml | 6 - .../PlatformParameterResource.hbm.xml | 3 - .../hbm/proxy/core/FeatureResource.hbm.xml | 2 +- .../hbm/proxy/core/LocationResource.hbm.xml | 2 +- .../hbm/proxy/core/OfferingResource.hbm.xml | 2 +- .../hbm/proxy/dataset/DataResource.hbm.xml | 14 +- .../hbm/proxy/dataset/DatasetResource.hbm.xml | 2 +- .../hbm/proxy/sampling/DataResource.hbm.xml | 14 +- .../proxy/sampling/DatasetResource.hbm.xml | 2 +- .../hbm/proxy/staplus/DataResource.hbm.xml | 14 +- .../hbm/proxy/staplus/DatasetResource.hbm.xml | 2 +- .../hbm/simple/core/FeatureResource.hbm.xml | 2 +- .../hbm/simple/core/OfferingResource.hbm.xml | 2 +- .../hbm/simple/dataset/DataResource.hbm.xml | 6 +- .../hbm/simple/sampling/DataResource.hbm.xml | 6 +- .../core/FeatureResource.hbm.xml | 2 +- .../core/LocationResource.hbm.xml | 2 +- .../core/OfferingResource.hbm.xml | 2 +- .../dataset/DataResource.hbm.xml | 16 +- .../dataset/DatasetResource.hbm.xml | 2 +- .../sampling/DataResource.hbm.xml | 14 +- .../sampling/DatasetResource.hbm.xml | 2 +- .../staplus/DataResource.hbm.xml | 14 +- .../staplus/DatasetResource.hbm.xml | 2 +- mappings/src/main/resources/hibernate.cfg.xml | 1 + pom.xml | 287 ++++++++---- rewrite.yml | 70 +++ test.py | 24 ++ types/pom.xml | 2 +- .../n52/hibernate/type/SmallBooleanType.java | 44 +- 295 files changed, 966 insertions(+), 1915 deletions(-) delete mode 100644 dialects/pom.xml delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/h2geodb/TimestampWithTimeZoneGeoDBDialect.java delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL57SpatialDialect.java delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL8SpatialDialect.java delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/oracle/TimestampWithTimeZoneOracleSpatial10gDialect.java delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/postgis/TimestampWithTimeZonePostgisPG95Dialect.java delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2008SpatialDialect.java delete mode 100644 dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2012SpatialDialect.java delete mode 100644 generator/pom.xml delete mode 100644 generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampMySQL8SpatialDialectNoComments.java delete mode 100644 generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneGeoDBDialectNoComments.java delete mode 100644 generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneOracleSpatial10gDialectNoComments.java delete mode 100644 generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZonePostgisPG95DialectNoComments.java delete mode 100644 generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2008SpatialDialectNoComments.java delete mode 100644 generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments.java delete mode 100644 generator/src/main/java/org/n52/series/db/generator/AbstractGenerator.java delete mode 100644 generator/src/main/java/org/n52/series/db/generator/SQLScriptGenerator.java delete mode 100644 generator/src/main/java/org/n52/series/db/generator/TableMetadataGenerator.java delete mode 100644 generator/src/main/resources/logback.xml delete mode 100644 generator/src/test/java/org/n52/series/db/generator/SQLScriptGeneratorTest.java delete mode 100644 generator/src/test/java/org/n52/series/db/generator/TableMetadataGeneratorTest.java delete mode 100644 generator/src/test/resources/logback-test.xml create mode 100644 rewrite.yml create mode 100644 test.py diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index e494a50e0..71d1f6208 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -15,7 +15,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 11 + java-version: 17 - name: Build with Maven run: mvn -U -B clean install @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 11 + java-version: 17 server-id: sonatype-nexus-snapshots server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0e3cd938d..739307b58 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -33,7 +33,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 11 + java-version: 17 server-id: sonatype-nexus-snapshots server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD diff --git a/.github/workflows/push_java_8.yml b/.github/workflows/push_java_8.yml index e6254bdd3..aba627181 100644 --- a/.github/workflows/push_java_8.yml +++ b/.github/workflows/push_java_8.yml @@ -33,7 +33,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 8 + java-version: 17 server-id: sonatype-nexus-snapshots server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD diff --git a/dialects/pom.xml b/dialects/pom.xml deleted file mode 100644 index af0c3e09e..000000000 --- a/dialects/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.n52.sensorweb-server.db-model - db-model-parent - 4.0.5-SNAPSHOT - - db-model-dialects - jar - Sensor Web Server Database Model - Hibernate Spatial Dialects - - - - org.hibernate - hibernate-core - provided - - - org.hibernate - hibernate-spatial - - - org.geolatte - geolatte-geom - provided - - - - - diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/h2geodb/TimestampWithTimeZoneGeoDBDialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/h2geodb/TimestampWithTimeZoneGeoDBDialect.java deleted file mode 100644 index 23f9ae41c..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/h2geodb/TimestampWithTimeZoneGeoDBDialect.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.h2geodb; - -import java.sql.Types; - -import org.hibernate.spatial.dialect.h2geodb.GeoDBDialect; - -public class TimestampWithTimeZoneGeoDBDialect extends GeoDBDialect { - - private static final long serialVersionUID = 3719262383564175336L; - - public TimestampWithTimeZoneGeoDBDialect() { - super(); - registerColumnType(Types.TIMESTAMP, "timestamp with time zone"); - } -} diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL57SpatialDialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL57SpatialDialect.java deleted file mode 100644 index 2d46bc871..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL57SpatialDialect.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.mysql; - -import java.sql.Types; - -import org.hibernate.HibernateException; -import org.hibernate.spatial.dialect.mysql.MySQL56SpatialDialect; - -public class TimestampMySQL57SpatialDialect extends MySQL56SpatialDialect { - - private static final long serialVersionUID = -8145146230035810465L; - private static final String TIMESTAMP = "timestamp"; - - public TimestampMySQL57SpatialDialect() { - super(); - registerColumnType(Types.TIMESTAMP, TIMESTAMP); - } - - @Override - public String getTypeName(int code, long length, int precision, int scale) throws HibernateException { - if (Types.TIMESTAMP == code) { - return TIMESTAMP; - } - return super.getTypeName(code, length, precision, scale); - } - - @Override - public String getTypeName(int code) throws HibernateException { - if (Types.TIMESTAMP == code) { - return TIMESTAMP; - } - return super.getTypeName(code); - } - - @Override - public String getNullColumnString() { - return " NULL"; - } -} diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL8SpatialDialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL8SpatialDialect.java deleted file mode 100644 index 18c44fc9b..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/mysql/TimestampMySQL8SpatialDialect.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.mysql; - -import java.sql.Types; - -import org.hibernate.HibernateException; -import org.hibernate.spatial.dialect.mysql.MySQL8SpatialDialect; - -public class TimestampMySQL8SpatialDialect extends MySQL8SpatialDialect { - - private static final long serialVersionUID = -8145146230035810465L; - private static final String TIMESTAMP = "timestamp"; - - public TimestampMySQL8SpatialDialect() { - super(); - registerColumnType(Types.TIMESTAMP, TIMESTAMP); - } - - @Override - public String getTypeName(int code, long length, int precision, int scale) throws HibernateException { - if (Types.TIMESTAMP == code) { - return TIMESTAMP; - } - return super.getTypeName(code, length, precision, scale); - } - - @Override - public String getTypeName(int code) throws HibernateException { - if (Types.TIMESTAMP == code) { - return TIMESTAMP; - } - return super.getTypeName(code); - } - - @Override - public String getNullColumnString() { - return " NULL"; - } -} diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/oracle/TimestampWithTimeZoneOracleSpatial10gDialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/oracle/TimestampWithTimeZoneOracleSpatial10gDialect.java deleted file mode 100644 index 44e94c3b3..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/oracle/TimestampWithTimeZoneOracleSpatial10gDialect.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.oracle; - -import java.sql.Types; - -import org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect; - -public class TimestampWithTimeZoneOracleSpatial10gDialect extends OracleSpatial10gDialect { - - private static final long serialVersionUID = 2459190033248440220L; - - public TimestampWithTimeZoneOracleSpatial10gDialect() { - super(); - registerColumnType(Types.DOUBLE, "float"); - registerColumnType(Types.TIMESTAMP, "timestamp with time zone"); - } - -} diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/postgis/TimestampWithTimeZonePostgisPG95Dialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/postgis/TimestampWithTimeZonePostgisPG95Dialect.java deleted file mode 100644 index f028045e0..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/postgis/TimestampWithTimeZonePostgisPG95Dialect.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.postgis; - -import java.sql.Types; - -import org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect; - -public class TimestampWithTimeZonePostgisPG95Dialect extends PostgisPG95Dialect { - - private static final long serialVersionUID = -3409681181015765469L; - - public TimestampWithTimeZonePostgisPG95Dialect() { - super(); - registerColumnType(Types.TIMESTAMP, "timestamp with time zone"); - } - -} diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2008SpatialDialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2008SpatialDialect.java deleted file mode 100644 index c208e70cd..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2008SpatialDialect.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.sqlserver; - -import java.sql.Types; - -import org.hibernate.spatial.dialect.sqlserver.SqlServer2008SpatialDialect; - -public class TimestampWithTimeZoneSqlServer2008SpatialDialect extends SqlServer2008SpatialDialect { - - private static final long serialVersionUID = -5075490566512423995L; - - public TimestampWithTimeZoneSqlServer2008SpatialDialect() { - super(); - registerColumnType(Types.TIMESTAMP, "datetimeoffset"); - } - -} diff --git a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2012SpatialDialect.java b/dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2012SpatialDialect.java deleted file mode 100644 index b3a0feed6..000000000 --- a/dialects/src/main/java/org/n52/hibernate/spatial/dialect/sqlserver/TimestampWithTimeZoneSqlServer2012SpatialDialect.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect.sqlserver; - -import java.sql.Types; - -import org.hibernate.spatial.dialect.sqlserver.SqlServer2012SpatialDialect; - -public class TimestampWithTimeZoneSqlServer2012SpatialDialect extends SqlServer2012SpatialDialect { - - private static final long serialVersionUID = -5075490566512423995L; - - public TimestampWithTimeZoneSqlServer2012SpatialDialect() { - super(); - registerColumnType(Types.TIMESTAMP, "datetimeoffset"); - } - -} diff --git a/entities/pom.xml b/entities/pom.xml index 1b0afcf4a..26436717e 100644 --- a/entities/pom.xml +++ b/entities/pom.xml @@ -11,19 +11,13 @@ Sensor Web Server Database Model - Entities - - - javax - javaee-api - - com.neovisionaries nv-i18n - com.google.code.findbugs - jsr305 + jakarta.persistence + jakarta.persistence-api @@ -39,6 +33,11 @@ spotbugs-annotations provided + + jakarta.annotation + jakarta.annotation-api + provided + org.slf4j diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java index 11a01037d..ce9201985 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Timestamp; @@ -57,6 +58,7 @@ public class AbstractDatasetEntity extends DescribableEntity public static final String PROPERTY_UNIT = "unit"; public static final String PROPERTY_AGGREGATION = "aggregation"; public static final String PROPERTY_PROJECT = "project"; + @Serial private static final long serialVersionUID = 4178505006632345142L; private AbstractFeatureEntity feature; diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java index 734c48b2b..591bcf37a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -38,6 +39,7 @@ public abstract class AbstractFeatureEntity extends HierarchicalEntity public static final String PROPERTY_GEOMETRY_ENTITY_LON = PROPERTY_GEOMETRY_ENTITY + ".lon"; public static final String PROPERTY_FEATURE_TYPE = "featureType"; + @Serial private static final long serialVersionUID = 6712642995944229067L; private GeometryEntity geometryEntity; private FormatEntity featureType; @@ -126,7 +128,7 @@ public int hashCode() { @Override public boolean equals(Object obj) { - return obj instanceof AbstractFeatureEntity && super.equals(obj) - && Objects.hash(observations) == Objects.hash(((AbstractFeatureEntity) obj).getObservations()); + return obj instanceof AbstractFeatureEntity afe && super.equals(obj) + && Objects.hash(observations) == Objects.hash(afe.getObservations()); } } diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java index 66b0d0a11..0d9c8f7e0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java @@ -15,11 +15,14 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public abstract class AbstractRelationEntity extends IdEntity { public static final String PROPERTY_ITEM = "item"; public static final String PROPERTY_RELATED_ITEM = "relatedItem"; + @Serial private static final long serialVersionUID = -2573767006446257428L; private T item; diff --git a/entities/src/main/java/org/n52/series/db/beans/AssessmentTypeEntity.java b/entities/src/main/java/org/n52/series/db/beans/AssessmentTypeEntity.java index 9e439c033..6ba5d5cdb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AssessmentTypeEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AssessmentTypeEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; public class AssessmentTypeEntity implements Serializable { @@ -23,6 +24,7 @@ public class AssessmentTypeEntity implements Serializable { public static final String PROPERTY_ASSESSMENT_TYPE = PROPERTY_ID; + @Serial private static final long serialVersionUID = 1721670905098408954L; private String assessmentType; diff --git a/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java index 2f4f5c4fd..21857cebf 100644 --- a/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; public class BlobDataEntity extends DataEntity { + @Serial private static final long serialVersionUID = 2881474333508410655L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java index 8968ed5b1..2a40cfa77 100644 --- a/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; public class BooleanDataEntity extends DataEntity { + @Serial private static final long serialVersionUID = -8729150886271878177L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java index ad171abb8..b629bc980 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; public class CategoryDataEntity extends DataEntity { + @Serial private static final long serialVersionUID = -4691677115635740162L; private String valueIdentifier; diff --git a/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java index ed41fb3da..04e122752 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java @@ -15,8 +15,11 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public class CategoryEntity extends DescribableEntity { + @Serial private static final long serialVersionUID = -5508957540970020954L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java b/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java index db9e4bd7d..2583a568d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import org.n52.series.db.beans.HibernateRelations.HasIdentifierCodespace; @@ -28,6 +29,7 @@ public class CodespaceEntity extends IdEntity implements Serializable { public static final String PROPERTY_NAME = "name"; + @Serial private static final long serialVersionUID = 8795086004488469603L; private String name; diff --git a/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java index b80c10149..315e0f4fe 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; public class ComplexDataEntity extends CompositeDataEntity { + @Serial private static final long serialVersionUID = 2206385928964743369L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java index f33cdde77..bbd1bc3cf 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java @@ -15,11 +15,13 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; import java.util.Set; public abstract class CompositeDataEntity extends DataEntity>> { + @Serial private static final long serialVersionUID = -2942122854792122664L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java index bc89392c2..bd48d65db 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -26,6 +27,7 @@ public class CountDataEntity extends DataEntity implements NumericalDat private static final Logger LOGGER = LoggerFactory.getLogger(CountDataEntity.class); + @Serial private static final long serialVersionUID = -8559375927338360585L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java index 8e36cb060..83328ab1b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -22,6 +23,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class DataArrayDataEntity extends CompositeDataEntity { + @Serial private static final long serialVersionUID = -1618516259763515255L; private ResultTemplateEntity resultTemplate; diff --git a/entities/src/main/java/org/n52/series/db/beans/DataEntity.java b/entities/src/main/java/org/n52/series/db/beans/DataEntity.java index 25c796818..b0ed29e68 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DataEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; import java.util.Comparator; @@ -92,6 +93,7 @@ public abstract class DataEntity extends DescribableEntity implements Compara public static final BigDecimal NOT_SET_VERTICAL = BigDecimal.valueOf(0); + @Serial private static final long serialVersionUID = 273612846605300612L; private Date samplingTimeStart; diff --git a/entities/src/main/java/org/n52/series/db/beans/DatasetAggregationEntity.java b/entities/src/main/java/org/n52/series/db/beans/DatasetAggregationEntity.java index c6b60e919..ccb61e09c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DatasetAggregationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DatasetAggregationEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -26,6 +27,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class DatasetAggregationEntity extends AbstractDatasetEntity { + @Serial private static final long serialVersionUID = 4214347342270609845L; private Set datasets; @@ -72,8 +74,8 @@ public void copy(AbstractDatasetEntity dataset) { setResultTimes(dataset.getResultTimes().stream().collect(Collectors.toSet())); } setUnit(dataset.getUnit()); - if (dataset instanceof DatasetAggregationEntity) { - setDatasets(((DatasetAggregationEntity) dataset).getDatasets()); + if (dataset instanceof DatasetAggregationEntity entity) { + setDatasets(entity.getDatasets()); } } diff --git a/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java index 734e03c41..9ba05e384 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java @@ -22,6 +22,7 @@ import org.n52.series.db.beans.dataset.ValueType; import org.n52.series.db.beans.sampling.SamplingProfileDatasetEntity; +import java.io.Serial; import java.time.ZoneOffset; import java.util.List; import java.util.Set; @@ -49,6 +50,7 @@ public class DatasetEntity extends AbstractDatasetEntity implements HasTags { public static final String PROPERTY_SAMPLING_PROFILE = "samplingProfile"; public static final String PROPERTY_EREPORTING_PROFILE = "ereportingProfile"; private static final String OFFSET_REGEX = "([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])"; + @Serial private static final long serialVersionUID = -7491530543976690237L; private boolean published = true; diff --git a/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java b/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java index 204e63926..6491a86e0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.util.LinkedHashSet; import java.util.Objects; @@ -39,6 +40,7 @@ public abstract class DescribableEntity extends IdEntity implements Describable, public static final String PROPERTY_DOMAIN_ID = PROPERTY_IDENTIFIER; public static final String PROPERTY_CODESPACE = PROPERTY_IDENTIFIER_CODESPACE; + @Serial private static final long serialVersionUID = -4448231483118864847L; /** diff --git a/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java index a127e894b..20fdbe431 100644 --- a/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java @@ -15,8 +15,11 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public class FeatureEntity extends AbstractFeatureEntity { + @Serial private static final long serialVersionUID = 3926633318714623558L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java b/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java index c9e915645..32a3a120c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public class FormatEntity extends IdEntity { public static final String FORMAT = "format"; + @Serial private static final long serialVersionUID = -8428858401445365107L; private String format; diff --git a/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java index 0bb1ab337..838be0935 100644 --- a/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; public class GeometryDataEntity extends DataEntity { + @Serial private static final long serialVersionUID = 3759168838980730712L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java b/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java index 9f02fe59c..0f21a81c8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.util.StringJoiner; @@ -35,6 +36,7 @@ public class GeometryEntity implements Serializable { public static final String PROPERTY_ALT = "alt"; public static final String PROPERTY_SRID = "srid"; + @Serial private static final long serialVersionUID = -1411829809704409439L; private GeometryFactory geometryFactory = new GeometryFactory(); diff --git a/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java b/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java index fddaa5701..37525bfd5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.LinkedHashSet; import java.util.Set; @@ -25,6 +26,7 @@ public abstract class HierarchicalEntity extends DescribableEntity { public static final String PROPERTY_PARENTS = "parents"; public static final String PROPERTY_CHILDREN = "children"; + @Serial private static final long serialVersionUID = -530148269689996337L; private Set children; diff --git a/entities/src/main/java/org/n52/series/db/beans/IdEntity.java b/entities/src/main/java/org/n52/series/db/beans/IdEntity.java index 0b6371376..2a4de7428 100644 --- a/entities/src/main/java/org/n52/series/db/beans/IdEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/IdEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -24,6 +25,7 @@ public abstract class IdEntity implements Serializable, HasId { public static final String PROPERTY_ID = "id"; + @Serial private static final long serialVersionUID = 1608995723035752862L; /** diff --git a/entities/src/main/java/org/n52/series/db/beans/NetworkEntity.java b/entities/src/main/java/org/n52/series/db/beans/NetworkEntity.java index ead1fff5a..74cb393df 100644 --- a/entities/src/main/java/org/n52/series/db/beans/NetworkEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/NetworkEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + /** * Entity for AQD e-Reporting Network * @@ -25,6 +27,7 @@ public class NetworkEntity extends DescribableEntity { public static final String ID = "network"; + @Serial private static final long serialVersionUID = -6039520306580755303L; private Long network; diff --git a/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java b/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java index 4775f2d65..c638aefb0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java @@ -26,6 +26,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; import java.util.Date; import java.util.Set; @@ -38,6 +39,7 @@ public class OfferingEntity extends HierarchicalEntity implement public static final String PROPERTY_RESULT_TIME_START = "resultTimeStart"; public static final String PROPERTY_RESULT_TIME_END = "resultTimeEnd"; + @Serial private static final long serialVersionUID = 5862607025737865794L; private GeometryEntity geometryEntity; diff --git a/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java b/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java index f22995abc..c2758fd9f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java @@ -19,6 +19,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; import java.util.Objects; import java.util.Set; @@ -26,6 +27,7 @@ public class PhenomenonEntity extends HierarchicalEntity implements HibernateRelations.HasAbstractDatasets, IsStaEntity { + @Serial private static final long serialVersionUID = 2302654989683191424L; private Set datasets; diff --git a/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java b/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java index 911c30ed3..9ca180d6e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java @@ -22,6 +22,7 @@ import org.n52.series.db.beans.sta.StaRelations; import org.n52.series.db.beans.sta.StaRelations.HasLocations; +import java.io.Serial; import java.util.LinkedHashSet; import java.util.Set; @@ -37,6 +38,7 @@ public class PlatformEntity extends DescribableEntity implements HasLocations locations; diff --git a/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java index 7a6edba99..55f0370ce 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java @@ -21,6 +21,7 @@ import org.n52.series.db.beans.HibernateRelations.HasProcedureHistory; import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +import java.io.Serial; import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -35,6 +36,7 @@ public class ProcedureEntity extends HierarchicalEntity impleme public static final String PROPERTY_PROCEDURE_DESCRIPTION_FORMAT = "format"; public static final String PROPERTY_DESCRIPTION_FILE = "descriptionFile"; + @Serial private static final long serialVersionUID = 4028002933920185756L; private boolean reference; diff --git a/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java index baabcec8d..abdf9f00b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.util.Date; @@ -36,6 +37,7 @@ public class ProcedureHistoryEntity extends IdEntity public static final String START_TIME = "startTime"; public static final String END_TIME = "endTime"; + @Serial private static final long serialVersionUID = -3658568714438752174L; private FormatEntity format; diff --git a/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java index d7d089245..84935afb9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; public class ProfileDataEntity extends CompositeDataEntity { + @Serial private static final long serialVersionUID = -7431276500677067329L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java index b779396de..6ed2feb27 100644 --- a/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collection; @@ -27,6 +28,7 @@ public class QuantityDataEntity extends DataEntity implements Numeri public static final BigDecimal DOUBLE_THRESHOLD = BigDecimal.valueOf(0.0001d); private static final Logger LOGGER = LoggerFactory.getLogger(QuantityDataEntity.class); + @Serial private static final long serialVersionUID = 7619426522406105659L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java index 6c3cd06c3..5e881fe08 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java @@ -15,11 +15,13 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; import java.util.Map; public class RecordDataEntity extends DataEntity> { + @Serial private static final long serialVersionUID = -7378123892897587598L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java index 355a852c2..969cf33aa 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; public class ReferencedDataEntity extends DataEntity { + @Serial private static final long serialVersionUID = 4925354534934095827L; private String valueIdentifier; diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java index b9171c61a..2b272bc7b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java @@ -15,8 +15,11 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public class RelatedDataEntity extends AbstractRelationEntity> { + @Serial private static final long serialVersionUID = 2436177373903826414L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java index 15dae81e7..e0a9b862a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java @@ -15,8 +15,11 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public class RelatedDatasetEntity extends AbstractRelationEntity { + @Serial private static final long serialVersionUID = 280165490758286290L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java index f637e756f..8debb0f39 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import java.util.HashSet; import java.util.Set; @@ -30,6 +31,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class RelatedFeatureEntity extends IdEntity implements Serializable, HasFeature, HasOfferings { public static final String PROPERTY_SERVICE = "service"; + @Serial private static final long serialVersionUID = -8143897383050691280L; private AbstractFeatureEntity feature; diff --git a/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java b/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java index dfed10028..e6927437f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; import org.n52.series.db.beans.HibernateRelations.HasResultEncoding; @@ -40,6 +41,7 @@ public class ResultTemplateEntity extends IdEntity implements Serializable, HasR public static final String PROPERTY_CATEGORY = "category"; + @Serial private static final long serialVersionUID = -8847952458819368733L; private PhenomenonEntity phenomenon; diff --git a/entities/src/main/java/org/n52/series/db/beans/SamplingGeometryEntity.java b/entities/src/main/java/org/n52/series/db/beans/SamplingGeometryEntity.java index cdebaf966..5745d94c8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/SamplingGeometryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/SamplingGeometryEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Date; import org.n52.series.db.common.Utils; @@ -24,6 +25,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class SamplingGeometryEntity extends IdEntity { + @Serial private static final long serialVersionUID = -3036211037882973515L; private Date timestamp; diff --git a/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java b/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java index 6099f92f4..a6508c866 100644 --- a/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; /** @@ -22,6 +23,7 @@ */ public class SensorML20DataEntity extends DataEntity { + @Serial private static final long serialVersionUID = 6575930482296453999L; private String value; diff --git a/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java b/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java index 379f5fa88..ee00693c4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.math.BigDecimal; import java.util.Arrays; import java.util.Collection; @@ -28,6 +29,7 @@ public class ServiceEntity extends DescribableEntity { + @Serial private static final long serialVersionUID = 8926184900932191238L; private static final Logger LOGGER = LoggerFactory.getLogger(ServiceEntity.class); @@ -137,10 +139,10 @@ public boolean isSetServiceMetadata() { } private boolean checkNoDataValue(DataEntity observation) { - if (observation instanceof QuantityDataEntity) { - return ((QuantityDataEntity) observation).checkNoDataValue(quantityNoDataValues); - } else if (observation instanceof CountDataEntity) { - return ((CountDataEntity) observation).checkNoDataValue(countNoDataValues); + if (observation instanceof QuantityDataEntity entity1) { + return entity1.checkNoDataValue(quantityNoDataValues); + } else if (observation instanceof CountDataEntity entity) { + return entity.checkNoDataValue(countNoDataValues); } return observation.isNoDataValue(noDataValues); } diff --git a/entities/src/main/java/org/n52/series/db/beans/ServiceMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ServiceMetadataEntity.java index b3b73ed90..8c58bc2b9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ServiceMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ServiceMetadataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.io.Serializable; public class ServiceMetadataEntity implements Serializable { + @Serial private static final long serialVersionUID = -7921433199814370067L; private String metadata; private String format; diff --git a/entities/src/main/java/org/n52/series/db/beans/TagEntity.java b/entities/src/main/java/org/n52/series/db/beans/TagEntity.java index 88771d311..43e6e4c5e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TagEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TagEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; import org.n52.series.db.beans.HibernateRelations.HasDatasets; @@ -25,6 +26,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class TagEntity extends DescribableEntity implements HasDatasets { + @Serial private static final long serialVersionUID = 7851120161214727821L; private Set datasets; private Set> translations; diff --git a/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java index 3842ece3c..d6bf41a93 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Collection; public class TextDataEntity extends DataEntity { + @Serial private static final long serialVersionUID = 4925354534934095827L; private String valueIdentifier; diff --git a/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java index bf1ccc261..496cc2983 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; public class TrajectoryDataEntity extends CompositeDataEntity { + @Serial private static final long serialVersionUID = 2863299911063106407L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java b/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java index 73ac5dcc7..0c20fa18e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans; +import java.io.Serial; + public class UnitEntity extends DescribableEntity { public static final String PROPERTY_UNIT = PROPERTY_IDENTIFIER; public static final String PROPERTY_SYMBOL = PROPERTY_IDENTIFIER; + @Serial private static final long serialVersionUID = -7512483445911729980L; private String link; diff --git a/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java index 2f1db7d95..5af39d4a2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans; +import java.io.Serial; import java.util.Set; import org.n52.series.db.beans.i18n.I18nVerticalMetadataEntity; @@ -29,6 +30,7 @@ public class VerticalMetadataEntity extends IdEntity { public static final String PROPERTY_VERTICAL_ORIGIN_NAME = "verticalOriginName"; public static final String PROPERTY_VERTICAL_FROM_NAME = "verticalFromName"; public static final String PROPERTY_VERTICAL_TO_NAME = "verticalToName"; + @Serial private static final long serialVersionUID = 3156288491348980598L; private Short orientation; diff --git a/entities/src/main/java/org/n52/series/db/beans/ereporting/EReportingQualityEntity.java b/entities/src/main/java/org/n52/series/db/beans/ereporting/EReportingQualityEntity.java index f733c9e1b..856c9dfa2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ereporting/EReportingQualityEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ereporting/EReportingQualityEntity.java @@ -19,6 +19,7 @@ import org.n52.series.db.beans.ereporting.HiberanteEReportingRelations.EReportingQualityData; import org.n52.series.db.beans.ereporting.HiberanteEReportingRelations.HasPrimaryObservation; +import java.io.Serial; import java.math.BigDecimal; public class EReportingQualityEntity extends IdEntity implements HasPrimaryObservation, EReportingQualityData { @@ -29,6 +30,7 @@ public class EReportingQualityEntity extends IdEntity implements HasPrimaryObser public static final String PRIMARY_OBSERVATION = "primaryObservation"; + @Serial private static final long serialVersionUID = 1891418800348199576L; private long dataset; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java b/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java index 584ceb117..3ba00e1ba 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature; +import java.io.Serial; import java.util.Collection; import java.util.Collections; @@ -33,6 +34,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public abstract class AbstractMonitoringFeature extends FeatureEntity { + @Serial private static final long serialVersionUID = 3379003106634935899L; private MonitoringPointContent content; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/NilReasonEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/NilReasonEntity.java index 923084e14..9cbe3409b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/NilReasonEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/NilReasonEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature; +import java.io.Serial; + import org.n52.series.db.beans.DescribableEntity; /** @@ -23,6 +25,7 @@ */ public abstract class NilReasonEntity extends DescribableEntity { + @Serial private static final long serialVersionUID = -4118970139033618118L; private String nilReason; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/ReferenceEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/ReferenceEntity.java index 4972797b7..c5166525b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/ReferenceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/ReferenceEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.feature; +import java.io.Serial; + /** * @author Carsten Hollmann * @since 1.0.0 */ public abstract class ReferenceEntity extends NilReasonEntity { + @Serial private static final long serialVersionUID = -5926562773130484266L; private String href; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java index 42c792a41..3ca6f681a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature; +import java.io.Serial; import java.util.Date; import org.n52.series.db.beans.FeatureEntity; @@ -26,6 +27,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class SpecimenEntity extends FeatureEntity { + @Serial private static final long serialVersionUID = -1128862083434595324L; private String materialClass; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AbstractCiEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AbstractCiEntity.java index 718d544d3..572111d5f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AbstractCiEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AbstractCiEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; + import org.n52.series.db.beans.feature.ReferenceEntity; /** @@ -25,6 +27,7 @@ */ public abstract class AbstractCiEntity extends ReferenceEntity { + @Serial private static final long serialVersionUID = 7398216647031698387L; private String gmdid; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AddressEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AddressEntity.java index 1e1aed064..65914e197 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AddressEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/AddressEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class AddressEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = -1303589675919102730L; private Set deliveryPoint; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ContactEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ContactEntity.java index e77f4e48b..32746a10c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ContactEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ContactEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** @@ -26,6 +28,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class ContactEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = 8049831514286990626L; private TelephoneEntity phone; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExExtentEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExExtentEntity.java index 6222becdd..118e0dfd5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExExtentEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExExtentEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class ExExtentEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = -5851468464823597666L; private Set verticalExtent; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExVerticalExtentEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExVerticalExtentEntity.java index 1dd9bfbaf..41d2e2954 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExVerticalExtentEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ExVerticalExtentEntity.java @@ -19,6 +19,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * Hibernate entity for exVerticalExtent. * @@ -28,6 +30,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class ExVerticalExtentEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = 4387639041569175476L; private Double minimumValue; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/OnlineResourceEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/OnlineResourceEntity.java index 259c91b4b..c7f379c9b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/OnlineResourceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/OnlineResourceEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; + /** * Hibernate entity for onlineResource. * @@ -23,6 +25,7 @@ */ public class OnlineResourceEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = -7852109322377425189L; private String linkage; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ResponsiblePartyEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ResponsiblePartyEntity.java index 09ab0a248..1e2ad411a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ResponsiblePartyEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/ResponsiblePartyEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** @@ -26,6 +28,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class ResponsiblePartyEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = -371431604695988543L; private String individualName; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/RoleEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/RoleEntity.java index 9368f5ea2..cb549c85c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/RoleEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/RoleEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; + import org.n52.series.db.beans.feature.NilReasonEntity; /** @@ -25,6 +27,7 @@ */ public class RoleEntity extends NilReasonEntity { + @Serial private static final long serialVersionUID = -1503660379060188778L; private String codeList; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/TelephoneEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/TelephoneEntity.java index 0b4834c29..9e2c0f0d9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gmd/TelephoneEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gmd/TelephoneEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature.gmd; +import java.io.Serial; import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class TelephoneEntity extends AbstractCiEntity { + @Serial private static final long serialVersionUID = -3871291699397692580L; private Set voice; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gml/CoordinateSystemAxisEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gml/CoordinateSystemAxisEntity.java index 34fada47c..fa48c47c6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gml/CoordinateSystemAxisEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gml/CoordinateSystemAxisEntity.java @@ -22,6 +22,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * Hibernate entiity for the coordinateSystemAxis * @@ -31,6 +33,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class CoordinateSystemAxisEntity extends ReferenceEntity implements HasRemarks { + @Serial private static final long serialVersionUID = 1841614376918978967L; private String remarks; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gml/DomainOfValidityEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gml/DomainOfValidityEntity.java index bc8500cff..b8c6d6f2c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gml/DomainOfValidityEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gml/DomainOfValidityEntity.java @@ -20,6 +20,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * Hibernate entiity for the domainOfValidity * @@ -29,6 +31,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class DomainOfValidityEntity extends ReferenceEntity { + @Serial private static final long serialVersionUID = -8008081097916414101L; private ExExtentEntity exExtent; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCRSEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCRSEntity.java index a9f8f9bad..7ff158ce5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCRSEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCRSEntity.java @@ -20,6 +20,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; import java.util.Set; /** @@ -31,6 +32,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class VerticalCRSEntity extends ReferenceEntity implements HasRemarks { + @Serial private static final long serialVersionUID = 2282402634799023149L; private String remarks; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCSEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCSEntity.java index 64e22c7b3..0193508e9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCSEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalCSEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature.gml; +import java.io.Serial; import java.util.Set; import org.n52.series.db.beans.HibernateRelations.HasRemarks; @@ -31,6 +32,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class VerticalCSEntity extends ReferenceEntity implements HasRemarks { + @Serial private static final long serialVersionUID = 8459136724611955821L; private String remarks; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalDatumEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalDatumEntity.java index 8d245c4b7..9bc323599 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalDatumEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/gml/VerticalDatumEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature.gml; +import java.io.Serial; import java.util.Date; import java.util.Set; @@ -34,6 +35,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class VerticalDatumEntity extends ReferenceEntity implements HasRemarks { + @Serial private static final long serialVersionUID = -2829473090233745827L; private String remarks; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/inspire/EnvironmentalMonitoringFacilityEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/inspire/EnvironmentalMonitoringFacilityEntity.java index 57643eae0..4d79eac69 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/inspire/EnvironmentalMonitoringFacilityEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/inspire/EnvironmentalMonitoringFacilityEntity.java @@ -19,9 +19,12 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class EnvironmentalMonitoringFacilityEntity extends FeatureEntity { + @Serial private static final long serialVersionUID = -6086090544397897675L; private MediaMonitored mediaMonitored; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/inspire/MediaMonitored.java b/entities/src/main/java/org/n52/series/db/beans/feature/inspire/MediaMonitored.java index c448391e9..70a32d882 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/inspire/MediaMonitored.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/inspire/MediaMonitored.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.feature.inspire; +import java.io.Serial; import java.io.Serializable; import java.util.Set; @@ -23,6 +24,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class MediaMonitored implements Serializable { + @Serial private static final long serialVersionUID = 6901599832181367565L; private long feature; diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java index accfc56d8..b2866829f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.feature.wml; +import java.io.Serial; + import org.n52.series.db.beans.feature.AbstractMonitoringFeature; /** @@ -25,6 +27,7 @@ */ public class MonitoringPointEntity extends AbstractMonitoringFeature { + @Serial private static final long serialVersionUID = -7745394070855227473L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java index aad7488f6..656d493a9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; import java.util.Objects; import org.n52.series.db.beans.IdEntity; @@ -26,6 +27,7 @@ public abstract class AbstractI18nEntity extends IdEntity { public static final String PROPERTY_LOCALE = "locale"; public static final String PROPERTY_ENTITY = "entity"; + @Serial private static final long serialVersionUID = -5046004232290585428L; private T entity; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java index 51adee0e6..30b7e95f6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.CategoryEntity; public class I18nCategoryEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -203423201673121632L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java index c502c7985..b8cfc9d6c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.DataEntity; public class I18nDataEntity extends I18nEntity> { + @Serial private static final long serialVersionUID = 6049859871182587108L; private String valueName; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java index 8e610d641..2283920c2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.DescribableEntity; public class I18nDatasetEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -6806171135616112674L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java index 5673c8a04..e77c84a41 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.DescribableEntity; public class I18nEntity extends AbstractI18nEntity { @@ -23,6 +25,7 @@ public class I18nEntity extends AbstractI18nEntity< public static final String PROPERTY_ENTITY = "entity"; + @Serial private static final long serialVersionUID = 693520332508628558L; private String name; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java index 564d8a258..881539367 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.FeatureEntity; public class I18nFeatureEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -4298562921888278009L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java index 8915971ae..047e42603 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sta.GroupEntity; public class I18nGroupEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -5781478911573046378L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java index 0035977bc..514e39842 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sta.LicenseEntity; public class I18nLicenseEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -4934084508058855199L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java index c83c7ec87..230f17cc0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sta.LocationEntity; public class I18nLocationEntity extends I18nEntity { + @Serial private static final long serialVersionUID = 1667966645309819316L; private String location; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java index 797f6f32f..e759142a6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sampling.MeasuringProgramEntity; public class I18nMeasuringProgramEntity extends I18nEntity { + @Serial private static final long serialVersionUID = 6723784868565645349L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java index d6b00e24a..f574fc8e5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.OfferingEntity; public class I18nOfferingEntity extends I18nEntity { + @Serial private static final long serialVersionUID = 6049859871182587108L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java index d8304e155..c774299c3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sta.PartyEntity; public class I18nPartyEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -3190517311536946742L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java index 1fc14effd..15a4f25ac 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.PhenomenonEntity; public class I18nPhenomenonEntity extends I18nEntity { + @Serial private static final long serialVersionUID = 8139714432806062380L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java index f29f0f4ba..e3f36b4fd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.PlatformEntity; public class I18nPlatformEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -1921468522255863839L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java index c4f68d1bb..639c537cc 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.ProcedureEntity; public class I18nProcedureEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -7990237043788544558L; private String shortName; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProfileDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProfileDataEntity.java index 69f6933a6..67bdbca38 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProfileDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProfileDataEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.ProfileDataEntity; public class I18nProfileDataEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -1039313696988014573L; private String orientation; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java index 75f852e38..793d0a4df 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java @@ -15,9 +15,12 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sta.ProjectEntity; public class I18nProjectEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -1541904527369601026L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java index 45c53a816..a564a6eae 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.sampling.SamplingEntity; public class I18nSamplingEntity extends I18nEntity { + @Serial private static final long serialVersionUID = 6375003360445007130L; private String samplingMethod; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java index 0a5afea5f..5144ddc86 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.ServiceEntity; public class I18nServiceEntity extends I18nEntity { + @Serial private static final long serialVersionUID = 3194966888990805278L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java index 78cc4b585..81e6da1c1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.TagEntity; public class I18nTagEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -203423201673121632L; // serves for clear distinction diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java index 32eff33da..c64d8975f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.UnitEntity; public class I18nUnitEntity extends I18nEntity { + @Serial private static final long serialVersionUID = -611501137242466095L; // re-uses existing i18n logic diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java index d2799a8f1..e4a831e23 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans.i18n; +import java.io.Serial; + import org.n52.series.db.beans.VerticalMetadataEntity; public class I18nVerticalMetadataEntity extends AbstractI18nEntity { + @Serial private static final long serialVersionUID = 329570776993990200L; private String verticalOriginName; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java index 674e14647..7945a0612 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter; +import java.io.Serial; import java.sql.Timestamp; import java.util.Date; import java.util.HashMap; @@ -32,6 +33,7 @@ public abstract class ParameterEntity extends IdEntity public static final String PROPERTY_PARENT = "parent"; + @Serial private static final long serialVersionUID = -1489503368673412638L; private String name; private String description; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java index eea35965e..47001ecde 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -22,6 +24,7 @@ */ public class DatasetBooleanParameterEntity extends DatasetParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java index 73b95e701..6ffbfb7d3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class DatasetCategoryParameterEntity extends DatasetParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java index 4a6a0790e..5ecd9365a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class DatasetComplexParameterEntity extends DatasetParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java index f06b6b3a8..d53ace4ec 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class DatasetCountParameterEntity extends DatasetParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java index e283e9380..8a834f108 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class DatasetJsonParameterEntity extends DatasetParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java index a13a56906..ea636c9e8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class DatasetParameterEntity extends ParameterEntity { public static final String PROP_DATASET = "dataset"; public static final String PROP_DATASET_ID = "datasetId"; + @Serial private static final long serialVersionUID = 8580995030975785255L; private AbstractDatasetEntity dataset; private Long datasetId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java index 556d41c5e..24b8018d6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class DatasetQuantityParameterEntity extends DatasetParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java index dfb7a6766..38efdc66e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class DatasetTemporalParameterEntity extends DatasetParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java index 2b010faa5..9c4e85848 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class DatasetTextParameterEntity extends DatasetParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java index 9038472d8..6738641d0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.dataset; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class DatasetXmlParameterEntity extends DatasetParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java index c588e4204..54af36a91 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -22,6 +24,7 @@ */ public class FeatureBooleanParameterEntity extends FeatureParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java index 6d41a1d8c..47f4bcd77 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class FeatureCategoryParameterEntity extends FeatureParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java index 51afa4841..965b0ec02 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class FeatureComplexParameterEntity extends FeatureParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java index d76362e80..20eea0f08 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class FeatureCountParameterEntity extends FeatureParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java index 04fccea91..b3daa8a75 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class FeatureJsonParameterEntity extends FeatureParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java index b7fd3a953..c1f0fd440 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class FeatureParameterEntity extends ParameterEntity { public static final String PROP_FEATURE = "feature"; public static final String PROP_FEATURE_ID = "featureId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; private AbstractFeatureEntity feature; private Long featureId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java index facb69448..2c65a62b5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class FeatureQuantityParameterEntity extends FeatureParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java index f3ed68c21..0368a4d89 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class FeatureTemporalParameterEntity extends FeatureParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java index 5d2d2bea9..cea911dd4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class FeatureTextParameterEntity extends FeatureParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java index 2acd2ecb7..65d3ca880 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.feature; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class FeatureXmlParameterEntity extends FeatureParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupBooleanParameterEntity.java index 8a805ac7e..47a1ba653 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -22,6 +24,7 @@ */ public class GroupBooleanParameterEntity extends GroupParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCategoryParameterEntity.java index 674e71017..0302e14cc 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class GroupCategoryParameterEntity extends GroupParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupComplexParameterEntity.java index 7e20132f0..a4537d0b7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class GroupComplexParameterEntity extends GroupParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCountParameterEntity.java index 20963f969..044caf202 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class GroupCountParameterEntity extends GroupParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupJsonParameterEntity.java index 20000fc05..8bbb7dc12 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class GroupJsonParameterEntity extends GroupParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java index 61446801f..b011898bc 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class GroupParameterEntity extends ParameterEntity { public static final String PROP_GROUP = "group"; public static final String PROP_GROUP_ID = "groupId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; private GroupEntity group; private Long groupId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupQuantityParameterEntity.java index 3ae312d17..86c8d05f1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -29,6 +30,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class GroupQuantityParameterEntity extends GroupParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTemporalParameterEntity.java index 92f814005..31730f0aa 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTemporalParameterEntity.java @@ -15,11 +15,14 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class GroupTemporalParameterEntity extends GroupParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTextParameterEntity.java index 14b1a6875..fcef6d5a1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class GroupTextParameterEntity extends GroupParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupXmlParameterEntity.java index 89e47cc37..709ee0d14 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.group; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class GroupXmlParameterEntity extends GroupParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseBooleanParameterEntity.java index 4be077b89..6e2a7410f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LicenseBooleanParameterEntity extends LicenseParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCategoryParameterEntity.java index 801676df3..1cbb6b383 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class LicenseCategoryParameterEntity extends LicenseParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseComplexParameterEntity.java index 88a46bfa3..6c8a8ce11 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class LicenseComplexParameterEntity extends LicenseParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCountParameterEntity.java index 692d1c7f4..79757d4d6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LicenseCountParameterEntity extends LicenseParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseJsonParameterEntity.java index 617fe09f7..3edcfcd45 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LicenseJsonParameterEntity extends LicenseParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java index 35050cf0b..9f73e56ec 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class LicenseParameterEntity extends ParameterEntity { public static final String PROP_GROUP = "license"; public static final String PROP_GROUP_ID = "licenseId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; private LicenseEntity license; private Long licenseId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseQuantityParameterEntity.java index 797bd70e1..43778d334 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class LicenseQuantityParameterEntity extends LicenseParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTemporalParameterEntity.java index b280d2af7..ec3143809 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class LicenseTemporalParameterEntity extends LicenseParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTextParameterEntity.java index 2c83b2d03..1b5b6c6ad 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LicenseTextParameterEntity extends LicenseParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseXmlParameterEntity.java index 84c42a2cb..289129db4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.license; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LicenseXmlParameterEntity extends LicenseParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java index e2b49b04e..77507e4ba 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -23,6 +25,7 @@ public class LocationBooleanParameterEntity extends LocationParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java index e3e437122..c9f324980 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -29,6 +30,7 @@ public class LocationCategoryParameterEntity extends LocationParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java index d212fac94..2df33f2fa 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class LocationComplexParameterEntity extends LocationParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java index 8fa3651ca..17fab5170 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LocationCountParameterEntity extends LocationParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java index 97ff78ff0..6c8ada947 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LocationJsonParameterEntity extends LocationParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java index 12dac1713..299bf92e9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class LocationParameterEntity extends ParameterEntity { public static final String PROP_LOCATION = "location"; public static final String PROP_LOCATION_ID = "locationId"; + @Serial private static final long serialVersionUID = 8449960591522592006L; private LocationEntity location; private Long locationId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java index 442ab9436..a3ba8a784 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class LocationQuantityParameterEntity extends LocationParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java index 9221d491d..01038a4d3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class LocationTemporalParameterEntity extends LocationParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java index 054c784c8..dd7fc053b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LocationTextParameterEntity extends LocationParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java index 285fc421e..c1fb7c8f7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.location; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class LocationXmlParameterEntity extends LocationParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java index f0880b69d..62e7eeddb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -23,6 +25,7 @@ public class ObservationBooleanParameterEntity extends ObservationParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java index 9854a1ba0..d3bf6ad6f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -29,6 +30,7 @@ public class ObservationCategoryParameterEntity extends ObservationParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java index 0cc83a1e0..4324fe44a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class ObservationComplexParameterEntity extends ObservationParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java index 4dc27ff06..23ef6f2c8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -23,6 +25,7 @@ public class ObservationCountParameterEntity extends ObservationParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java index f797be97b..c511e4347 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ObservationJsonParameterEntity extends ObservationParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java index 126eb36a1..8f58335b9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class ObservationParameterEntity extends ParameterEntity { public static final String PROP_OBSERVATION = "observation"; public static final String PROP_OBSERVATION_ID = "observationId"; + @Serial private static final long serialVersionUID = -3170715124801725482L; private DataEntity observation; private Long observationId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java index 3cc6e805a..36072aa15 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class ObservationQuantityParameterEntity extends ObservationParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java index dca916611..e555bcffd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class ObservationTemporalParameterEntity extends ObservationParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java index 44c963531..a05e9a2ff 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ObservationTextParameterEntity extends ObservationParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java index 25e1f9537..10167c5dd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.observation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ObservationXmlParameterEntity extends ObservationParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyBooleanParameterEntity.java index 93e7ed492..b6e0d5cb5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PartyBooleanParameterEntity extends PartyParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCategoryParameterEntity.java index 1f54ab793..0aaa1a626 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class PartyCategoryParameterEntity extends PartyParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyComplexParameterEntity.java index 601cb5910..631f5fac8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class PartyComplexParameterEntity extends PartyParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCountParameterEntity.java index 3b0fc3f72..db38a4ef0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PartyCountParameterEntity extends PartyParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyJsonParameterEntity.java index d019b8d54..3e0a56580 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PartyJsonParameterEntity extends PartyParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java index 780e1f4fa..77a8ef1cb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class PartyParameterEntity extends ParameterEntity { public static final String PROP_GROUP = "party"; public static final String PROP_GROUP_ID = "partyId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; private PartyEntity party; private Long partyId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyQuantityParameterEntity.java index c095392cb..13e033d44 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -29,6 +30,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class PartyQuantityParameterEntity extends PartyParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTemporalParameterEntity.java index 777518eda..2212119c1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTemporalParameterEntity.java @@ -15,11 +15,14 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class PartyTemporalParameterEntity extends PartyParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTextParameterEntity.java index f2eea79f4..0d0a70b81 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PartyTextParameterEntity extends PartyParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyXmlParameterEntity.java index 6af32ddcc..f469f982e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.party; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PartyXmlParameterEntity extends PartyParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java index 093e8a811..ec0a8f2da 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -23,6 +25,7 @@ public class PhenomenonBooleanParameterEntity extends PhenomenonParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java index 75cd2e6ce..a08ca2f56 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -29,6 +30,7 @@ public class PhenomenonCategoryParameterEntity extends PhenomenonParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java index 81039a5d3..bca049eef 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class PhenomenonComplexParameterEntity extends PhenomenonParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java index bf6131841..d26557b13 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -23,6 +25,7 @@ public class PhenomenonCountParameterEntity extends PhenomenonParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java index 4618dce10..f83ca7e5c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PhenomenonJsonParameterEntity extends PhenomenonParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java index c8f713c4a..9337fa3aa 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class PhenomenonParameterEntity extends ParameterEntity { public static final String PROP_PHENOMENON = "phenomenon"; public static final String PROP_PHENOMENON_ID = "phenomenonId"; + @Serial private static final long serialVersionUID = 5234864540316301294L; private PhenomenonEntity phenomenon; private Long phenomenonId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java index 24c62531d..7c1f4f793 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class PhenomenonQuantityParameterEntity extends PhenomenonParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java index 82c52feb1..bb3dcef47 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class PhenomenonTemporalParameterEntity extends PhenomenonParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java index e5d914c0c..19d4d949f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PhenomenonTextParameterEntity extends PhenomenonParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java index 7129a6708..fb2fa2728 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PhenomenonXmlParameterEntity extends PhenomenonParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java index a7bf9d6df..c401831d2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -23,6 +25,7 @@ public class PlatformBooleanParameterEntity extends PlatformParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java index 0e1840a1b..49b1a020a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -29,6 +30,7 @@ public class PlatformCategoryParameterEntity extends PlatformParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java index fa23db465..3b535b423 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class PlatformComplexParameterEntity extends PlatformParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java index 4a17d98ba..a7235b77d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PlatformCountParameterEntity extends PlatformParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java index 7c337a02d..e0bae8da2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PlatformJsonParameterEntity extends PlatformParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java index e796c504b..434eb13e8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class PlatformParameterEntity extends ParameterEntity { public static final String PROP_PLATFORM = "platform"; public static final String PROP_PLATFORM_ID = "platformId"; + @Serial private static final long serialVersionUID = -8427939633323086462L; private PlatformEntity platform; private Long platformId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java index 838af7efd..fd4098179 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class PlatformQuantityParameterEntity extends PlatformParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java index fc0714c0c..bb723c1dd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class PlatformTemporalParameterEntity extends PlatformParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java index 9dfe44e00..cf6d1b244 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PlatformTextParameterEntity extends PlatformParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java index 0e9dc1c2d..525853e4e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.platform; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class PlatformXmlParameterEntity extends PlatformParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java index 6f4e405fe..c958f9b58 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -23,6 +25,7 @@ public class ProcedureBooleanParameterEntity extends ProcedureParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java index 3420af6f0..974002caf 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -29,6 +30,7 @@ public class ProcedureCategoryParameterEntity extends ProcedureParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java index b40d4f63d..98a84863c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class ProcedureComplexParameterEntity extends ProcedureParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java index ef8dbe89d..996436670 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProcedureCountParameterEntity extends ProcedureParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java index 01e6814ed..f9b0b9671 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProcedureJsonParameterEntity extends ProcedureParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java index 594a65a8c..ccbf656ce 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class ProcedureParameterEntity extends ParameterEntity { public static final String PROP_PROCEDURE = "procedure"; public static final String PROP_PROCEDURE_ID = "procedureId"; + @Serial private static final long serialVersionUID = -3203271103169023133L; private ProcedureEntity procedure; private Long procedureId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java index 155f4a19c..01e9393e4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class ProcedureQuantityParameterEntity extends ProcedureParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java index 7d1ebd12c..6a4fcd876 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class ProcedureTemporalParameterEntity extends ProcedureParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java index 07fba9767..eacbe559f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProcedureTextParameterEntity extends ProcedureParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java index 816c954c4..c2cb0f716 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.procedure; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProcedureXmlParameterEntity extends ProcedureParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectBooleanParameterEntity.java index d526b8861..97940156e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProjectBooleanParameterEntity extends ProjectParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCategoryParameterEntity.java index 68228c05a..5d15ff7a4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -28,6 +29,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class ProjectCategoryParameterEntity extends ProjectParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectComplexParameterEntity.java index fa893e4e8..08217decb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class ProjectComplexParameterEntity extends ProjectParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCountParameterEntity.java index 4bd979ede..aae525d4b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProjectCountParameterEntity extends ProjectParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectJsonParameterEntity.java index e57ffa6f3..0c405c879 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProjectJsonParameterEntity extends ProjectParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java index 032bb4c91..ca8f8735a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -29,6 +31,7 @@ public abstract class ProjectParameterEntity extends ParameterEntity { public static final String PROP_GROUP = "project"; public static final String PROP_GROUP_ID = "projectId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; private ProjectEntity project; private Long projectId; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectQuantityParameterEntity.java index fe1a3e746..b7a2902fb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class ProjectQuantityParameterEntity extends ProjectParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTemporalParameterEntity.java index a89ebf1af..fe14c11ca 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class ProjectTemporalParameterEntity extends ProjectParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTextParameterEntity.java index c74584bf5..407c47f48 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProjectTextParameterEntity extends ProjectParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectXmlParameterEntity.java index cf108d188..85cfd86f3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.project; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class ProjectXmlParameterEntity extends ProjectParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationBooleanParameterEntity.java index 19a2c6361..f2cacd485 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationBooleanParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** @@ -23,6 +25,7 @@ public class RelationBooleanParameterEntity extends RelationParameterEntity implements BooleanParameterEntity { + @Serial private static final long serialVersionUID = -1280123654095577480L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCategoryParameterEntity.java index 62bbe0211..a4da6aff4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCategoryParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; import java.util.Map; import org.n52.series.db.beans.UnitEntity; @@ -29,6 +30,7 @@ public class RelationCategoryParameterEntity extends RelationParameterEntity implements CategoryParameterEntity { + @Serial private static final long serialVersionUID = -6262887605542676492L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationComplexParameterEntity.java index 27df740cb..02915afdf 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationComplexParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ public class RelationComplexParameterEntity extends RelationParameterEntity>> implements ComplexParameterEntity>> { + @Serial private static final long serialVersionUID = -5166758396873257962L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCountParameterEntity.java index 7ae847dc8..1d8dad786 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationCountParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.CountParameterEntity; /** @@ -22,6 +24,7 @@ */ public class RelationCountParameterEntity extends RelationParameterEntity implements CountParameterEntity { + @Serial private static final long serialVersionUID = -7778025481981408886L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationJsonParameterEntity.java index b2a4ab043..766739f1e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationJsonParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.JsonParameterEntity; /** @@ -22,6 +24,7 @@ */ public class RelationJsonParameterEntity extends RelationParameterEntity implements JsonParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java index 2fffbccb3..9747a8fdb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java @@ -21,6 +21,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + /** * @author Jan Speckamp */ @@ -30,6 +32,7 @@ public abstract class RelationParameterEntity extends ParameterEntity { public static final String PROP_GROUP = "group"; public static final String PROP_GROUP_ID = "groupId"; public static final String PROPERTY_RELATION_ID = "relationId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; private RelationEntity relation; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationQuantityParameterEntity.java index 5e96c291b..46638c64b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationQuantityParameterEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; import java.math.BigDecimal; import java.util.Map; @@ -30,6 +31,7 @@ public class RelationQuantityParameterEntity extends RelationParameterEntity implements QuantityParameterEntity { + @Serial private static final long serialVersionUID = 7528516075676290716L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTemporalParameterEntity.java index 017cb4b00..608935a64 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTemporalParameterEntity.java @@ -15,12 +15,15 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; public class RelationTemporalParameterEntity extends RelationParameterEntity implements TemporalParameterEntity { + @Serial private static final long serialVersionUID = 668796579118721620L; } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTextParameterEntity.java index 0a512fcd5..3110a5f7c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationTextParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.TextParameterEntity; /** @@ -22,6 +24,7 @@ */ public class RelationTextParameterEntity extends RelationParameterEntity implements TextParameterEntity { + @Serial private static final long serialVersionUID = 3300965770609382377L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationXmlParameterEntity.java index 688b03a75..225c97e18 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationXmlParameterEntity.java @@ -15,6 +15,8 @@ */ package org.n52.series.db.beans.parameter.relation; +import java.io.Serial; + import org.n52.series.db.beans.parameter.XmlParameterEntity; /** @@ -22,6 +24,7 @@ */ public class RelationXmlParameterEntity extends RelationParameterEntity implements XmlParameterEntity { + @Serial private static final long serialVersionUID = 1209102870245642049L; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/quality/QualityEntity.java b/entities/src/main/java/org/n52/series/db/beans/quality/QualityEntity.java index 577dfd78c..5de1de2ad 100644 --- a/entities/src/main/java/org/n52/series/db/beans/quality/QualityEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/quality/QualityEntity.java @@ -21,9 +21,12 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; + @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public abstract class QualityEntity extends DescribableEntity implements HasUnitValue { + @Serial private static final long serialVersionUID = 4794651765162321131L; private UnitEntity unit; diff --git a/entities/src/main/java/org/n52/series/db/beans/quality/QuantityQualityEntity.java b/entities/src/main/java/org/n52/series/db/beans/quality/QuantityQualityEntity.java index 72370baa9..7c71c1f11 100644 --- a/entities/src/main/java/org/n52/series/db/beans/quality/QuantityQualityEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/quality/QuantityQualityEntity.java @@ -15,10 +15,12 @@ */ package org.n52.series.db.beans.quality; +import java.io.Serial; import java.math.BigDecimal; public class QuantityQualityEntity extends QualityEntity { + @Serial private static final long serialVersionUID = 8313784962549255489L; private BigDecimal value; diff --git a/entities/src/main/java/org/n52/series/db/beans/quality/TextQualityEntity.java b/entities/src/main/java/org/n52/series/db/beans/quality/TextQualityEntity.java index 69aeb4f5e..d9b894313 100644 --- a/entities/src/main/java/org/n52/series/db/beans/quality/TextQualityEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/quality/TextQualityEntity.java @@ -15,8 +15,11 @@ */ package org.n52.series.db.beans.quality; +import java.io.Serial; + public class TextQualityEntity extends QualityEntity { + @Serial private static final long serialVersionUID = 6016434040907309530L; private String value; diff --git a/entities/src/main/java/org/n52/series/db/beans/sampling/MeasuringProgramEntity.java b/entities/src/main/java/org/n52/series/db/beans/sampling/MeasuringProgramEntity.java index d41e30347..e463e0f59 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sampling/MeasuringProgramEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sampling/MeasuringProgramEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sampling; +import java.io.Serial; import java.util.Date; import java.util.Set; @@ -38,6 +39,7 @@ public class MeasuringProgramEntity extends DescribableEntity implements HasData public static final String PROPERTY_PRODUCER = "producer"; + @Serial private static final long serialVersionUID = 2525309717383048842L; private String producer; diff --git a/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingEntity.java b/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingEntity.java index 4d64021d6..9671cc342 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sampling; +import java.io.Serial; import java.util.Date; import java.util.Set; @@ -40,6 +41,7 @@ public class SamplingEntity extends DescribableEntity implements HasDatasets, Ha public static final String PROPERTY_SAMPLING_TIME_END = "samplingTimeEnd"; + @Serial private static final long serialVersionUID = -8840602794587590180L; private Set datasets; diff --git a/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingProfileDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingProfileDatasetEntity.java index eefbf1d22..f04dc1d9c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingProfileDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sampling/SamplingProfileDatasetEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sampling; +import java.io.Serial; import java.io.Serializable; import java.util.Set; import java.util.stream.Collectors; @@ -28,6 +29,7 @@ public class SamplingProfileDatasetEntity implements Serializable { public static final String PROPERTY_SAMPLING_IDS = "samplingIds"; public static final String PROPERTY_MEASURING_PROGRAMS = "measuringPrograms"; + @Serial private static final long serialVersionUID = -6526107787041904177L; private boolean hasSamplings; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/AbstractObservationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/AbstractObservationEntity.java index 404deaf28..5fb4a9148 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/AbstractObservationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/AbstractObservationEntity.java @@ -15,9 +15,10 @@ */ package org.n52.series.db.beans.sta; +import java.io.Serial; import java.io.Serializable; -import javax.persistence.Transient; +import jakarta.persistence.Transient; import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.IdEntity; @@ -29,6 +30,7 @@ public abstract class AbstractObservationEntity extends IdEntity implements S HibernateRelations.HasDescription, HibernateRelations.HasSamplingGeometry, HibernateRelations.HasFeature, HibernateRelations.IsProcessed, HibernateRelations.IsStaEntity, HibernateRelations.HasVerticalFromTo { + @Serial private static final long serialVersionUID = -5478132580391608848L; @Transient diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java index be9a4bd1e..d16cafe78 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sta; +import java.io.Serial; import java.io.Serializable; import java.util.Date; import java.util.Set; @@ -35,6 +36,7 @@ public class GroupEntity extends DescribableEntity public static final String PROPERTY_RELATIONS = "relations"; public static final String PROPERTY_PURPOSE = "purpose"; public static final String PROPERTY_OBSERVATIONS = "observations"; + @Serial private static final long serialVersionUID = -1355442833604724327L; private String purpose; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java index 737785227..3594f26b2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java @@ -22,6 +22,7 @@ import org.n52.series.db.beans.sta.StaRelations.HasLocations; import org.n52.series.db.common.Utils; +import java.io.Serial; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -42,6 +43,7 @@ public class HistoricalLocationEntity extends DescribableEntity implements Seria public static final String PROPERTY_PLATFORM = "platform"; public static final String PROPERTY_THING = PROPERTY_PLATFORM; + @Serial private static final long serialVersionUID = 5564686026419270062L; private Date time; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java index 2b1f5727e..ed6fcf145 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sta; +import java.io.Serial; import java.io.Serializable; import java.util.Set; @@ -32,6 +33,7 @@ public class LicenseEntity extends DescribableEntity public static final String PROPERTY_DEFINITION = PROPERTY_IDENTIFIER; public static final String PROPERTY_LOGO = "logo"; + @Serial private static final long serialVersionUID = -1938665500675268434L; private String logo; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java index d01284d6a..5d1e9d168 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java @@ -25,6 +25,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; import java.io.Serializable; import java.util.LinkedHashSet; import java.util.Set; @@ -43,6 +44,7 @@ public class LocationEntity extends DescribableEntity implements Serializable, H public static final String PROPERTY_GEOMETRY_ENTITY = "geometryEntity"; public static final String PROPERTY_LOCATION_ENCODING = "locationEncoding"; + @Serial private static final long serialVersionUID = -8201429072560300649L; private String location; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java index d59ce3f7c..1e6c3d5a4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sta; +import java.io.Serial; import java.io.Serializable; import java.util.Set; @@ -33,6 +34,7 @@ public class PartyEntity extends DescribableEntity implements Serializable, Hibe public static final String PROPERTY_DISPLAY_NAME = "displayName"; public static final String PROPERTY_ROLE = "role"; + @Serial private static final long serialVersionUID = -7546755723749812564L; private RolePartyCode role = RolePartyCode.individual; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java index 3a0b7a0dd..84d45886f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sta; +import java.io.Serial; import java.io.Serializable; import java.util.Date; import java.util.Set; @@ -33,6 +34,7 @@ public class ProjectEntity extends DescribableEntity implements Serializable, Hi public static final String PROPERTY_CLASSIFICATION = "classification"; public static final String PROPERTY_TERMS_OF_USE = "termsOfUse"; public static final String PROPERTY_PRIVACY_POLICY = "privacyPolicy"; + @Serial private static final long serialVersionUID = -2909642026383185577L; private String classification; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/RelationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/RelationEntity.java index d19f93bf1..035a395c1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/RelationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/RelationEntity.java @@ -15,6 +15,7 @@ */ package org.n52.series.db.beans.sta; +import java.io.Serial; import java.util.Set; import org.n52.series.db.beans.DataEntity; @@ -30,6 +31,7 @@ public class RelationEntity extends DescribableEntity implements StaRelations.Ha public static final String PROPERTY_ROLE = "role"; public static final String PROPERTY_EXTERNAL_OBJECT = "externalObject"; + @Serial private static final long serialVersionUID = -8131424037218012268L; private String role; diff --git a/entities/src/main/java/org/n52/series/db/common/LocaleHelper.java b/entities/src/main/java/org/n52/series/db/common/LocaleHelper.java index e648ccafe..463f8e618 100644 --- a/entities/src/main/java/org/n52/series/db/common/LocaleHelper.java +++ b/entities/src/main/java/org/n52/series/db/common/LocaleHelper.java @@ -25,7 +25,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import com.neovisionaries.i18n.LanguageAlpha3Code; diff --git a/generator/pom.xml b/generator/pom.xml deleted file mode 100644 index 42a8243df..000000000 --- a/generator/pom.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - 4.0.0 - - org.n52.sensorweb-server.db-model - db-model-parent - 4.0.5-SNAPSHOT - - db-model-generator - jar - Sensor Web Server Database Model - Generator - - - 42.2.12 - 2.5.1 - 21.4.0.0.1 - 8.2.2.jre8 - 8.0.20 - 2.1.212 - 0.9 - 5.6.14.Final - - - - - ${project.groupId} - db-model-mappings - runtime - - - ${project.groupId} - db-model-entities - runtime - - - ${project.groupId} - db-model-types - - - ${project.groupId} - db-model-dialects - - - joda-time - joda-time - - - org.locationtech.jts - jts-core - provided - - - org.hibernate - hibernate-core - ${hibernate.version} - compile - - - com.sun.istack - istack-commons-runtime - - - org.osgi - org.osgi.core - - - - - org.hibernate - hibernate-spatial - ${hibernate.version} - provided - - - org.geolatte - geolatte-geom - provided - - - ch.qos.logback - logback-core - runtime - - - com.sun.xml.bind - jaxb-impl - 3.0.2 - runtime - - - com.github.spotbugs - spotbugs-annotations - provided - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.postgresql - postgresql - runtime - - - net.postgis - postgis-jdbc - runtime - - - com.oracle.database.jdbc - ojdbc8 - runtime - - - com.microsoft.sqlserver - mssql-jdbc - runtime - - - mysql - mysql-connector-java - runtime - - - com.h2database - h2 - runtime - - - org.opengeo - geodb - runtime - - - com.h2database - h2 - - - - - diff --git a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampMySQL8SpatialDialectNoComments.java b/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampMySQL8SpatialDialectNoComments.java deleted file mode 100644 index 6218d5533..000000000 --- a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampMySQL8SpatialDialectNoComments.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect; - -import org.n52.hibernate.spatial.dialect.mysql.TimestampMySQL8SpatialDialect; - -public class TimestampMySQL8SpatialDialectNoComments extends TimestampMySQL8SpatialDialect { - - private static final long serialVersionUID = 3047363357061126361L; - - public TimestampMySQL8SpatialDialectNoComments() { - super(); - } - - @Override - public boolean supportsCommentOn() { - return false; - } - -} diff --git a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneGeoDBDialectNoComments.java b/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneGeoDBDialectNoComments.java deleted file mode 100644 index 9527499eb..000000000 --- a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneGeoDBDialectNoComments.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect; - -import org.n52.hibernate.spatial.dialect.h2geodb.TimestampWithTimeZoneGeoDBDialect; - -public class TimestampWithTimeZoneGeoDBDialectNoComments extends TimestampWithTimeZoneGeoDBDialect { - - private static final long serialVersionUID = -6665874378395453171L; - - public TimestampWithTimeZoneGeoDBDialectNoComments() { - super(); - } - - @Override - public boolean supportsCommentOn() { - return false; - } - -} diff --git a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneOracleSpatial10gDialectNoComments.java b/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneOracleSpatial10gDialectNoComments.java deleted file mode 100644 index a88e690d5..000000000 --- a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneOracleSpatial10gDialectNoComments.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect; - -import org.n52.hibernate.spatial.dialect.oracle.TimestampWithTimeZoneOracleSpatial10gDialect; - -public class TimestampWithTimeZoneOracleSpatial10gDialectNoComments - extends TimestampWithTimeZoneOracleSpatial10gDialect { - - private static final long serialVersionUID = 3047363357061126361L; - - public TimestampWithTimeZoneOracleSpatial10gDialectNoComments() { - super(); - } - - @Override - public boolean supportsCommentOn() { - return false; - } - -} diff --git a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZonePostgisPG95DialectNoComments.java b/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZonePostgisPG95DialectNoComments.java deleted file mode 100644 index 475e7e720..000000000 --- a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZonePostgisPG95DialectNoComments.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect; - -import org.n52.hibernate.spatial.dialect.postgis.TimestampWithTimeZonePostgisPG95Dialect; - -public class TimestampWithTimeZonePostgisPG95DialectNoComments extends TimestampWithTimeZonePostgisPG95Dialect { - - private static final long serialVersionUID = 6664673127405665042L; - - public TimestampWithTimeZonePostgisPG95DialectNoComments() { - super(); - } - - @Override - public boolean supportsCommentOn() { - return false; - } -} diff --git a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2008SpatialDialectNoComments.java b/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2008SpatialDialectNoComments.java deleted file mode 100644 index cc0933828..000000000 --- a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2008SpatialDialectNoComments.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect; - -import org.n52.hibernate.spatial.dialect.sqlserver.TimestampWithTimeZoneSqlServer2008SpatialDialect; - -public class TimestampWithTimeZoneSqlServer2008SpatialDialectNoComments - extends TimestampWithTimeZoneSqlServer2008SpatialDialect { - - private static final long serialVersionUID = 4504714178692811427L; - - public TimestampWithTimeZoneSqlServer2008SpatialDialectNoComments() { - super(); - } - - @Override - public boolean supportsCommentOn() { - return false; - } - -} diff --git a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments.java b/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments.java deleted file mode 100644 index 2c191f973..000000000 --- a/generator/src/main/java/org/n52/hibernate/spatial/dialect/TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.hibernate.spatial.dialect; - -import org.n52.hibernate.spatial.dialect.sqlserver.TimestampWithTimeZoneSqlServer2012SpatialDialect; - -public class TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments - extends TimestampWithTimeZoneSqlServer2012SpatialDialect { - - private static final long serialVersionUID = -8276020761164021033L; - - public TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments() { - super(); - } - - @Override - public boolean supportsCommentOn() { - return false; - } - -} diff --git a/generator/src/main/java/org/n52/series/db/generator/AbstractGenerator.java b/generator/src/main/java/org/n52/series/db/generator/AbstractGenerator.java deleted file mode 100644 index 775b29b74..000000000 --- a/generator/src/main/java/org/n52/series/db/generator/AbstractGenerator.java +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.series.db.generator; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; - -import org.hibernate.boot.MetadataSources; -import org.hibernate.cfg.Configuration; -import org.hibernate.dialect.Dialect; -import org.n52.hibernate.spatial.dialect.TimestampMySQL8SpatialDialectNoComments; -import org.n52.hibernate.spatial.dialect.TimestampWithTimeZoneGeoDBDialectNoComments; -import org.n52.hibernate.spatial.dialect.TimestampWithTimeZoneOracleSpatial10gDialectNoComments; -import org.n52.hibernate.spatial.dialect.TimestampWithTimeZonePostgisPG95DialectNoComments; -import org.n52.hibernate.spatial.dialect.TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments; -import org.n52.hibernate.spatial.dialect.h2geodb.TimestampWithTimeZoneGeoDBDialect; -import org.n52.hibernate.spatial.dialect.mysql.TimestampMySQL8SpatialDialect; -import org.n52.hibernate.spatial.dialect.oracle.TimestampWithTimeZoneOracleSpatial10gDialect; -import org.n52.hibernate.spatial.dialect.postgis.TimestampWithTimeZonePostgisPG95Dialect; -import org.n52.hibernate.spatial.dialect.sqlserver.TimestampWithTimeZoneSqlServer2008SpatialDialect; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - -@SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public abstract class AbstractGenerator { - - protected static final String NEW_LINE = "\n"; - protected static final String PIPE = " | "; - private final boolean print; - - protected AbstractGenerator() { - this(true); - } - - protected AbstractGenerator(boolean print) { - this.print = print; - } - - protected Dialect getDialect(DialectSelector selection, boolean comments) throws Exception { - switch (selection) { - case ORACLE: - return comments ? new TimestampWithTimeZoneOracleSpatial10gDialect() - : new TimestampWithTimeZoneOracleSpatial10gDialectNoComments(); - case GEODB_H2: - return comments ? new TimestampWithTimeZoneGeoDBDialect() - : new TimestampWithTimeZoneGeoDBDialectNoComments(); - case MYSQL: - return comments ? new TimestampMySQL8SpatialDialect() : new TimestampMySQL8SpatialDialectNoComments(); - case SQL_SERVER: - return comments ? new TimestampWithTimeZoneSqlServer2008SpatialDialect() - : new TimestampWithTimeZoneSqlServer2012SpatialDialectNoComments(); - case POSTGIS: - default: - return comments ? new TimestampWithTimeZonePostgisPG95Dialect() - : new TimestampWithTimeZonePostgisPG95DialectNoComments(); - } - } - - protected int getDialectSelection() throws IOException { - printToScreen("This SQL script generator supports:"); - printToScreen("0 PostgreSQL/PostGIS"); - printToScreen("1 H2/GeoDB"); - printToScreen("2 MySQL"); - printToScreen("3 SQL Server"); - printToScreen("4 oracle"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIo(); - } - - protected int getModelSelection() throws IOException { - printToScreen("Which database model should be created:"); - printToScreen("0 default"); - printToScreen("1 sampling"); - printToScreen("2 staplus"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIo(); - } - - protected int getConceptSelection() throws IOException { - printToScreen("Which observation concept should be created:"); - printToScreen("0 simple"); - printToScreen("1 transactional"); - printToScreen("2 ereporting"); - printToScreen("3 proxy"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIo(); - } - - protected int getFeatureConceptSelection() throws IOException { - printToScreen("Which feature concept should be created:"); - printToScreen("0 default"); - printToScreen("1 extended"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIo(); - } - - protected void setDirectoriesForModelSelection(Concept concept, Profile profile, Feature feature, - Configuration configuration, MetadataSources metadataSources) throws Exception { - List files = new LinkedList<>(); - for (File file : files) { - if (configuration != null) { - configuration.addDirectory(file); - } - if (metadataSources != null) { - metadataSources.addDirectory(file); - } - } - addConceptDirectories(concept, profile, feature, configuration, metadataSources); - } - - protected void addConceptDirectories(Concept concept, Profile profile, Feature feature, - Configuration configuration, MetadataSources metadataSources) throws Exception { - List paths = new LinkedList<>(); - final String parameterMappingDir = "/hbm/parameter"; - switch (concept) { - case SIMPLE: - paths.addAll(getProfileDirectories("/hbm/simple", profile)); - break; - case E_REPORTING: - paths.addAll(getProfileDirectories("/hbm/ereporting", Profile.DEFAULT)); - paths.add(parameterMappingDir); - paths.addAll(getFeatureConceptDirectories(feature, configuration, metadataSources)); - break; - case PROXY: - paths.addAll(getProfileDirectories("/hbm/proxy", profile)); - paths.add(parameterMappingDir); - paths.addAll(getFeatureConceptDirectories(feature, configuration, metadataSources)); - break; - case TRANSACTIONAL: - default: - paths.addAll(getProfileDirectories("/hbm/transactional", profile)); - paths.add(parameterMappingDir); - paths.addAll(getFeatureConceptDirectories(feature, configuration, metadataSources)); - } - for (String path : paths) { - if (configuration != null) { - configuration.addDirectory(getDirectory(path)); - } - if (metadataSources != null) { - metadataSources.addDirectory(getDirectory(path)); - } - } - } - - @SuppressFBWarnings("SF_SWITCH_NO_DEFAULT") - protected List getFeatureConceptDirectories(Feature concept, Configuration configuration, - MetadataSources metadataSources) throws Exception { - List paths = new LinkedList<>(); - switch (concept) { - case EXTENDED: - paths.add("/hbm/feature"); - break; - case DEFAULT: - default: - // nothing to add - } - return paths; - } - - protected Collection getProfileDirectories(String p, Profile profile) { - List paths = new LinkedList<>(); - paths.add(p + "/core"); - switch (profile) { - case DEFAULT: - paths.add(p + "/dataset"); - break; - case SAMPLING: - paths.add(p + "/sampling"); - break; - case STA_PLUS: - paths.add("/hbm/staplus"); - paths.add(p + "/staplus"); - break; - default: - break; - } - return paths; - } - - protected File getDirectory(String path) throws URISyntaxException { - return new File(AbstractGenerator.class.getResource(path).toURI()); - } - - protected static void printToScreen(String lineToPrint) { - System.out.println(lineToPrint); - } - - protected static void printEnterYourSelection() { - printToScreen("Enter your selection: "); - } - - protected void printToSysout(String lineToPrint) { - if (print) { - System.out.println(lineToPrint); - } - } - - protected int readSelectionFromStdIo() throws IOException { - return readSelectionFromStdIoWithDefault(0); - } - - protected int readSelectionFromStdIoWithDefault(int defaultValue) throws IOException { - BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.forName("UTF-8"))); - String selection = br.readLine(); - return (selection != null && !selection.isEmpty()) ? Integer.parseInt(selection) : defaultValue; - } - - protected String createFileName(String prefix, String ending, Enum... values) { - StringJoiner joiner = new StringJoiner("_", "target/" + prefix, ending); - for (Enum value : values) { - joiner.add(value.name().toLowerCase()); - } - return joiner.toString(); - } - - enum DialectSelector { - POSTGIS, GEODB_H2, MYSQL, SQL_SERVER, ORACLE; - - @Override - public String toString() { - return name().replaceAll("_", "-").toLowerCase(); - } - } - - enum Concept { - SIMPLE, TRANSACTIONAL, E_REPORTING, PROXY; - - @Override - public String toString() { - return name().replaceAll("_", "-").toLowerCase(); - } - } - - enum Feature { - DEFAULT, EXTENDED; - - @Override - public String toString() { - return name().replaceAll("_", "-").toLowerCase(); - } - } - - enum Profile { - DEFAULT, SAMPLING, STA_PLUS; - - @Override - public String toString() { - return name().replaceAll("_", "-").toLowerCase(); - } - } - - public interface Meta { - - default String check(String origin, String current) { - return (origin != null && !origin.isEmpty()) ? origin - : (current != null && !current.isEmpty()) ? current : null; - } - - } - - public static class TableMetadata implements Meta { - private final String name; - - private final String comment; - - private Map columns = new LinkedHashMap<>(); - - public TableMetadata(String name, String comment) { - this.name = name; - this.comment = comment; - } - - public String getName() { - return name; - } - - public String getComment() { - return comment; - } - - public Map getColumns() { - return columns; - } - - public void setColumns(Map columns) { - this.columns = columns; - } - - public String toMarkdown() { - StringBuilder builder = new StringBuilder(); - builder.append("### ").append(getName()).append(NEW_LINE); - builder.append("**Description**: ").append(checkForNullOrEmpty(getComment())).append(NEW_LINE); - builder.append(NEW_LINE); - builder.append("| column | comment | NOT-NULL | default | SQL type | Java type |").append(NEW_LINE); - builder.append("| --- | --- | --- | --- | --- | --- |").append(NEW_LINE); - for (ColumnMetadata cm : columns.values()) { - builder.append("| ").append(cm.getName()).append(PIPE); - builder.append(checkForNullOrEmpty(cm.getComment())).append(PIPE); - builder.append(cm.getNotNull()).append(PIPE); - builder.append(checkForNullOrEmpty(cm.getDefaultValue())).append(PIPE); - builder.append(cm.getSqlType()).append(PIPE); - builder.append(cm.getType()).append(PIPE).append(NEW_LINE); - } - builder.append("\n[top](#Tables)\n"); - return builder.toString(); - } - - private String checkForNullOrEmpty(String value) { - return value != null && !value.isEmpty() ? value : "-"; - } - - } - - public static class ColumnMetadata implements Meta { - private final String name; - - private String comment; - - private String sqlType; - - private String type; - - private String defaultValue; - - private String notNull; - - public ColumnMetadata(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public String getComment() { - return comment; - } - - public void setComment(String comment) { - this.comment = check(this.comment, comment); - } - - public String getSqlType() { - return sqlType; - } - - public void setSqlType(String sqlType) { - this.sqlType = check(this.sqlType, sqlType); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = check(this.type, type); - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = check(this.defaultValue, defaultValue); - } - - public String getNotNull() { - return notNull; - } - - public void setNotNull(String notNull) { - this.notNull = check(this.notNull, notNull); - } - - } - -} diff --git a/generator/src/main/java/org/n52/series/db/generator/SQLScriptGenerator.java b/generator/src/main/java/org/n52/series/db/generator/SQLScriptGenerator.java deleted file mode 100644 index 89aab6620..000000000 --- a/generator/src/main/java/org/n52/series/db/generator/SQLScriptGenerator.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.series.db.generator; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.EnumSet; -import java.util.Properties; - -import org.hibernate.boot.Metadata; -import org.hibernate.boot.MetadataSources; -import org.hibernate.boot.registry.StandardServiceRegistry; -import org.hibernate.cfg.AvailableSettings; -import org.hibernate.cfg.Configuration; -import org.hibernate.dialect.Dialect; -import org.hibernate.tool.hbm2ddl.SchemaExport; -import org.hibernate.tool.schema.TargetType; -import org.n52.hibernate.type.SmallBooleanType; - -//import hibernate.spatial.dialect.oracle.OracleSpatial10gDoubleFloatDialect; - -/** - * Class to generate the create and drop scripts for different databases. Currently supported spatial - * databases to create scripts - *
    - *
  • PostgreSQL/PostGIS
  • - *
  • Oracle
  • - *
  • MySQL
  • - *
  • SQL Server
  • - *
  • H2/GeoDB
  • - *
- * - * @author Carsten Hollmann - * @since 1.0.0 - */ -@SuppressWarnings("uncommentedmain") -public final class SQLScriptGenerator extends AbstractGenerator { - - private static final String PUBLIC = "public"; - - private SQLScriptGenerator(boolean print) { - super(print); - } - - private int getSelection() throws IOException { - printToScreen("Create a all or a single selected script:"); - printToScreen("0 Select script"); - printToScreen("1 all"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIo(); - } - - private String getSchema() throws IOException { - printToScreen("For which schema should the database model be created?"); - printToScreen("No schema is also valid!"); - printToScreen(""); - printEnterYourSelection(); - BufferedReader br = new BufferedReader(new InputStreamReader(System.in, Charset.forName("UTF-8"))); - String selection = null; - selection = br.readLine(); - return selection; - } - - private String getSchema(int i) { - switch (i) { - case 1: - return PUBLIC; - case 2: - return null; - case 3: - return "sos"; - case 4: - return "dbo"; - case 5: - return "oracle"; - default: - return PUBLIC; - } - } - - private boolean getAddComments() throws IOException { - printToScreen("Should comments be added to the script (default=true):"); - printToScreen("0 false"); - printToScreen("1 true"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIoWithDefault(1) == 1; - } - - private void printFinished(String fileName) { - printToSysout("Finished! Check for file: " + fileName + NEW_LINE); - } - - private String createFileName(String ending, Enum... values) { - return createFileName("sql/", ending, values); - } - - private void execute(int dialectSelection, int profileSelection, int conceptSelection, int featureSelection, - String schema, boolean comments, boolean consoleLog) throws Exception { - Concept concept = Concept.values()[conceptSelection]; - Profile profile = Profile.values()[profileSelection]; - Feature feature = Feature.values()[featureSelection]; - Configuration configuration = new Configuration().configure("/hibernate.cfg.xml"); - DialectSelector dialect = DialectSelector.values()[dialectSelection]; - System.out.println(String.format("EXECUTING sql generation for %s - %s - %s - %s!", dialect.name(), - concept.name(), profile.name(), feature.name())); - Dialect dia = getDialect(dialect, comments); - Properties p = new Properties(); - p.put(AvailableSettings.DIALECT, dia.getClass().getName()); - String fileNameCreate = createFileName("_create.sql", dialect, concept, profile, feature); - String fileNameDrop = createFileName("_drop.sql", dialect, concept, profile, feature); - Files.deleteIfExists(Paths.get(fileNameCreate)); - Files.deleteIfExists(Paths.get(fileNameDrop)); - if (schema != null && !schema.isEmpty()) { - p.put(AvailableSettings.DEFAULT_SCHEMA, schema); - - } - if (dialect.equals(DialectSelector.POSTGIS) && (schema == null || schema.isEmpty())) { - p.put(AvailableSettings.DEFAULT_SCHEMA, PUBLIC); - } - configuration.addProperties(p); - setDirectoriesForModelSelection(concept, profile, feature, configuration, null); - configuration.registerTypeOverride(SmallBooleanType.INSTANCE); - - configuration.buildSessionFactory(); - StandardServiceRegistry serviceRegistry = - configuration.getStandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); - - MetadataSources metadataSources = new MetadataSources(serviceRegistry); - setDirectoriesForModelSelection(concept, profile, feature, null, metadataSources); - Metadata metadata = metadataSources.buildMetadata(); - - // create script - SchemaExport schemaExport = new SchemaExport(); - EnumSet targetTypes = - consoleLog ? EnumSet.of(TargetType.SCRIPT, TargetType.STDOUT) : EnumSet.of(TargetType.SCRIPT); - schemaExport.setDelimiter(";").setFormat(true).setOutputFile(fileNameCreate).setHaltOnError(false); - schemaExport.execute(targetTypes, SchemaExport.Action.CREATE, metadata); - printFinished(fileNameCreate); - // create drop - schemaExport.setOutputFile(fileNameDrop); - schemaExport.execute(targetTypes, SchemaExport.Action.DROP, metadata); - printFinished(fileNameDrop); - } - - protected boolean execute(Integer selection) throws Exception { - int select = selection != null ? selection : getSelection(); - if (select == 1) { - String schema = PUBLIC; - // dialectSelection - for (int i = 0; i < 5; i++) { - if (i != 1) { - schema = getSchema(i); - // modelSelection/profile - for (int j = 0; j < 3; j++) { - // concept - for (int k = 0; k < 4; k++) { - // feature - for (int l = 0; l < 2; l++) { - // execute(sqlScriptGenerator, i, j, k, l, schema); - execute(i, j, k, l, schema, true, false); - } - } - } - } - } - return true; - } else { - boolean addComments = getAddComments(); - int dialectSelection = getDialectSelection(); - int concept = getConceptSelection(); - int feature = getFeatureConceptSelection(); - String schema = getSchema(); - int modelSelection = getModelSelection(); - execute(dialectSelection, modelSelection, concept, feature, schema, addComments, true); - return true; - } - } - - protected static SQLScriptGenerator getInstance(boolean print) { - return new SQLScriptGenerator(print); - } - - public static void main(String[] args) { - try { - getInstance(true).execute(args != null && args.length == 1 ? Integer.parseInt(args[0]) : null); - } catch (IOException ioe) { - printToScreen("ERROR: IO error trying to read your input!"); - ioe.printStackTrace(); - System.exit(1); - } catch (Exception e) { - printToScreen("ERROR: Could not generate for unknown reasons!"); - e.printStackTrace(); - System.exit(1); - } - - } - -} diff --git a/generator/src/main/java/org/n52/series/db/generator/TableMetadataGenerator.java b/generator/src/main/java/org/n52/series/db/generator/TableMetadataGenerator.java deleted file mode 100644 index ace6cbcd2..000000000 --- a/generator/src/main/java/org/n52/series/db/generator/TableMetadataGenerator.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.series.db.generator; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.stream.Collectors; - -import org.hibernate.boot.Metadata; -import org.hibernate.boot.MetadataSources; -import org.hibernate.boot.registry.StandardServiceRegistry; -import org.hibernate.cfg.Configuration; -import org.hibernate.dialect.Dialect; -import org.hibernate.mapping.Column; -import org.hibernate.mapping.Join; -import org.hibernate.mapping.PersistentClass; -import org.hibernate.mapping.Property; -import org.hibernate.mapping.Table; -import org.joda.time.DateTime; -import org.joda.time.format.DateTimeFormat; -import org.n52.hibernate.type.SmallBooleanType; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - -/** - * Class to generate the create and drop scripts for different databases. Currently supported spatial - * databases to create scripts - *
    - *
  • PostgreSQL/PostGIS
  • - *
  • Oracle
  • - *
  • MySQL
  • - *
  • SQL Server
  • - *
  • H2/GeoDB
  • - *
- * - * @author Carsten Hollmann - * @since 1.0.0 - */ -@SuppressWarnings("uncommentedmain") -public final class TableMetadataGenerator extends AbstractGenerator { - - private TableMetadataGenerator() { - super(); - } - - private int getSelection() throws IOException { - printToScreen("Create a all or a single table metadata file:"); - printToScreen("0 Select table metadata"); - printToScreen("1 all"); - printToScreen(""); - printEnterYourSelection(); - - return readSelectionFromStdIo(); - } - - private String createFileName(Enum... values) { - return createFileName("metadata/TableMetadata_", ".md", values); - } - - private void exportTableColumnMetadata(Metadata metadata, Dialect dia, DialectSelector dialect, Concept concept, - Profile profile, Feature feature) throws IOException { - Path path = createFile(Paths.get(createFileName(dialect, concept, profile, feature))); - SortedMap map = extractTableMetadata(metadata, dia); - List result = new LinkedList<>(); - result.add("# Database table/column description"); - result.add("This page describes the tables and columns in the database."); - result.add("The *SQL type* column in the tables is generated for Hibernate dialect: *" - + dia.getClass().getSimpleName() + "*"); - result.add(""); - result.add("## Tables"); - map.keySet().forEach(k -> result.add("- [" + k + "](#" + k + ")")); - result.add(""); - result.addAll(map.values().stream().map(v -> v.toMarkdown()).collect(Collectors.toList())); - result.add(""); - result.add( - "*Creation date: " + DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss ZZ").print(DateTime.now()) + "*"); - System.out.println("The generated file was written to: " + Files.write(path, result).toAbsolutePath()); - } - - @SuppressFBWarnings - private Path createFile(Path path) throws IOException { - Files.deleteIfExists(path); - Files.createDirectories(path.getParent()); - return Files.createFile(path); - } - - private SortedMap extractTableMetadata(Metadata metadata, Dialect dia) { - SortedMap map = new TreeMap<>(); - for (PersistentClass entity : metadata.getEntityBindings()) { - Table table = entity.getTable(); - TableMetadata tm = processTable(table, map, dia, metadata); - processJoins(entity.getJoinClosureIterator(), map, dia, metadata); - // from Property - Iterator propertyIterator = entity.getPropertyIterator(); - while (propertyIterator.hasNext()) { - Property property = propertyIterator.next(); - if (property.getValue() instanceof org.hibernate.mapping.Collection) { - processCollection((org.hibernate.mapping.Collection) property.getValue(), map, dia, metadata); - } - processColumns(property.getColumnIterator(), tm.getColumns(), dia, metadata); - } - // from Identifier - processColumns(entity.getIdentifier().getColumnIterator(), tm.getColumns(), dia, metadata); - } - return map; - - } - - private void processJoins(Iterator ji, SortedMap map, Dialect dia, - Metadata metadata) { - if (ji != null) { - while (ji.hasNext()) { - processTable(ji.next().getTable(), map, dia, metadata); - } - } - } - - private void processCollection(org.hibernate.mapping.Collection collection, SortedMap map, - Dialect dia, Metadata metadata) { - Table table = collection.getCollectionTable(); - if (table != null) { - if (!map.containsKey(table.getName())) { - map.put(table.getName(), new TableMetadata(table.getName(), table.getComment())); - } - TableMetadata tm = map.get(table.getName()); - Map columns = tm.getColumns(); - // from Table - processColumns(table.getColumnIterator(), columns, dia, metadata); - } - } - - private TableMetadata processTable(Table table, SortedMap map, Dialect dia, - Metadata metadata) { - if (!map.containsKey(table.getName())) { - map.put(table.getName(), new TableMetadata(table.getName(), table.getComment())); - } - TableMetadata tm = map.get(table.getName()); - Map columns = tm.getColumns(); - // from Table - processColumns(table.getColumnIterator(), columns, dia, metadata); - return tm; - } - - private void processColumns(Iterator ci, Map columns, Dialect dia, Metadata metadata) { - while (ci.hasNext()) { - Object n = ci.next(); - if (n instanceof Column) { - Column next = (Column) n; - if (!columns.containsKey(next.getName())) { - columns.put(next.getName(), new ColumnMetadata(next.getName())); - } - ColumnMetadata cm = columns.get(next.getName()); - cm.setComment(next.getComment()); - cm.setSqlType(next.getSqlType(dia, metadata)); - cm.setType(next.getValue().getType().getName()); - cm.setDefaultValue(next.getDefaultValue()); - cm.setNotNull(Boolean.toString(!next.isNullable())); - } - } - } - - private void execute(int dialectSelection, int profileSelection, int conceptSelection, int featureSelection) - throws Exception { - Concept concept = Concept.values()[conceptSelection]; - Profile profile = Profile.values()[profileSelection]; - Feature feature = Feature.values()[featureSelection]; - Configuration configuration = new Configuration().configure("/hibernate.cfg.xml"); - DialectSelector dialect = DialectSelector.values()[dialectSelection]; - Dialect dia = getDialect(dialect, true); - Properties p = new Properties(); - p.put("hibernate.dialect", dia.getClass().getName()); - configuration.addProperties(p); - setDirectoriesForModelSelection(concept, profile, feature, configuration, null); - configuration.registerTypeOverride(SmallBooleanType.INSTANCE); - - configuration.buildSessionFactory(); - StandardServiceRegistry serviceRegistry = - configuration.getStandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); - - MetadataSources metadataSources = new MetadataSources(serviceRegistry); - setDirectoriesForModelSelection(concept, profile, feature, null, metadataSources); - Metadata metadata = metadataSources.buildMetadata(); - - exportTableColumnMetadata(metadata, dia, dialect, concept, profile, feature); - } - - protected boolean execute(Integer selection) throws Exception { - int select = selection != null ? selection : getSelection(); - if (select == 1) { - // dialectSelection - for (int i = 0; i < 4; i++) { - // modelSelection/profile - for (int j = 0; j < 2; j++) { - // concept - for (int k = 0; k < 4; k++) { - // feature - for (int l = 0; l < 2; l++) { - // execute(i, j, k, l); - execute(i, j, k, l); - } - - } - } - } - return true; - } else { - int dialectSelection = getDialectSelection(); - int concept = getConceptSelection(); - int modelSelection = getModelSelection(); - int feature = getFeatureConceptSelection(); - execute(dialectSelection, modelSelection, concept, feature); - return true; - } - } - - protected static TableMetadataGenerator getInstance() { - return new TableMetadataGenerator(); - } - - public static void main(String[] args) { - try { - getInstance().execute(args != null && args.length == 1 ? Integer.parseInt(args[0]) : null); - } catch (IOException ioe) { - printToScreen("ERROR: IO error trying to read your input!"); - ioe.printStackTrace(); - System.exit(1); - } catch (Exception e) { - printToScreen("ERROR: Could not generate for unknown reasons!"); - e.printStackTrace(); - System.exit(1); - } - - } - -} diff --git a/generator/src/main/resources/logback.xml b/generator/src/main/resources/logback.xml deleted file mode 100644 index 484c30382..000000000 --- a/generator/src/main/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} - %msg%n - - - - - - - - diff --git a/generator/src/test/java/org/n52/series/db/generator/SQLScriptGeneratorTest.java b/generator/src/test/java/org/n52/series/db/generator/SQLScriptGeneratorTest.java deleted file mode 100644 index cc564706e..000000000 --- a/generator/src/test/java/org/n52/series/db/generator/SQLScriptGeneratorTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.series.db.generator; - -import org.junit.jupiter.api.Assertions; -//import org.junit.jupiter.api.Test; - -public class SQLScriptGeneratorTest { - - // @Test - public void test_generation() throws Exception { - Assertions.assertTrue(SQLScriptGenerator.getInstance(false).execute(1)); - } - -} diff --git a/generator/src/test/java/org/n52/series/db/generator/TableMetadataGeneratorTest.java b/generator/src/test/java/org/n52/series/db/generator/TableMetadataGeneratorTest.java deleted file mode 100644 index 1e249ea98..000000000 --- a/generator/src/test/java/org/n52/series/db/generator/TableMetadataGeneratorTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.series.db.generator; - -import org.junit.jupiter.api.Assertions; - -public class TableMetadataGeneratorTest { - - // @Test - public void test_generation() throws Exception { - Assertions.assertTrue(TableMetadataGenerator.getInstance().execute(1)); - } - -} diff --git a/generator/src/test/resources/logback-test.xml b/generator/src/test/resources/logback-test.xml deleted file mode 100644 index 8206325a2..000000000 --- a/generator/src/test/resources/logback-test.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} - %msg%n - - - - - - - - diff --git a/mappings/pom.xml b/mappings/pom.xml index 2058b89cf..8d18841a8 100644 --- a/mappings/pom.xml +++ b/mappings/pom.xml @@ -12,6 +12,15 @@ + + + org.hibernate.orm + hibernate-maven-plugin + + true + + + src/main/hbm @@ -23,5 +32,6 @@ + diff --git a/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml index a437d48b2..284886617 100644 --- a/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml @@ -74,7 +74,7 @@ --> - + The geometry/location of feature diff --git a/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml index 0eba312fd..96bc10b5a 100644 --- a/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml @@ -30,7 +30,7 @@ - + diff --git a/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml index 9cf40dab6..f7c4c5d25 100644 --- a/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml @@ -80,7 +80,7 @@ --> - + The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. diff --git a/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml index e5e7c358d..d2c74f5cf 100644 --- a/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -266,7 +260,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml index e7bd1cc1d..8552fa0ec 100644 --- a/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml index 0f4c293bc..aa0023746 100644 --- a/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -274,7 +268,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml index f62caccf6..f892cb0cc 100644 --- a/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml b/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml index 0a7032ec2..935876941 100644 --- a/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -292,7 +286,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml index fe917506a..742dda968 100644 --- a/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml index d1da6df56..774bfca5a 100644 --- a/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml +++ b/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml @@ -47,9 +47,6 @@ Reference to the Dataset this Parameter describes. - - - @@ -129,12 +126,6 @@ - - - Reference to the Dataset this Parameter describes. - - diff --git a/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml index f440cbf12..196660eac 100644 --- a/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml +++ b/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml @@ -46,9 +46,6 @@ Reference to the Feature this Parameter describes. - - - @@ -128,12 +125,6 @@ - - - Reference to the Feature this Parameter describes. - - diff --git a/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml index fa1666efd..6137e83b6 100644 --- a/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml +++ b/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml @@ -129,12 +129,6 @@ - - - Reference to the Location this Parameter describes. - - diff --git a/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml index df4fafd21..fd8b14c64 100644 --- a/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml +++ b/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml @@ -129,12 +129,6 @@ - - - Reference to the Observation this Parameter describes. - - diff --git a/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml index 73b950034..bbd621015 100644 --- a/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml +++ b/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml @@ -46,9 +46,6 @@ Reference to the Platform this Parameter describes. - - - diff --git a/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml index 32f37f506..dab2700ca 100644 --- a/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml @@ -78,7 +78,7 @@ --> - + The geometry/location of feature diff --git a/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml b/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml index b82e72ab2..f2493379c 100644 --- a/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml @@ -35,7 +35,7 @@ - + diff --git a/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml index a422bb10e..1ee09abac 100644 --- a/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml @@ -85,7 +85,7 @@ --> - + The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. diff --git a/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml index ce743655f..15dd8f64e 100644 --- a/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -235,7 +229,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml index 9d4e2bb8e..f0cb30bc5 100644 --- a/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml index 3e40311a6..80ed49739 100644 --- a/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -242,7 +236,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml index 2568e4e75..4906829d7 100644 --- a/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml b/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml index 1df1821dc..d1040bcee 100644 --- a/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -260,7 +254,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml index f227b679a..9f753b462 100644 --- a/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml index 1f842f8eb..7dbfce14a 100644 --- a/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml +++ b/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml @@ -41,7 +41,7 @@ --> - + The geometry/location of feature diff --git a/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml index 154072dae..252bcc924 100644 --- a/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml +++ b/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml @@ -70,7 +70,7 @@ --> - + The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. diff --git a/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml index 5a2dcbe35..0484e1b34 100644 --- a/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml +++ b/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml @@ -24,9 +24,7 @@ Reference to the dataset to which this observation belongs. - - - + @@ -87,7 +85,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. diff --git a/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml index ade84194b..fe4ce8b62 100644 --- a/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml +++ b/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml @@ -23,9 +23,7 @@ Reference to the dataset to which this observation belongs. - - - + @@ -86,7 +84,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. diff --git a/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml index a437d48b2..284886617 100644 --- a/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml @@ -74,7 +74,7 @@ --> - + The geometry/location of feature diff --git a/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml b/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml index 0eba312fd..96bc10b5a 100644 --- a/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml @@ -30,7 +30,7 @@ - + diff --git a/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml index 9cf40dab6..f7c4c5d25 100644 --- a/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml @@ -80,7 +80,7 @@ --> - + The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. diff --git a/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml index df4088c4f..13091cf39 100644 --- a/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -234,7 +228,7 @@ --> - + The geometry value of an observation (GeometryObservation) @@ -296,10 +290,12 @@ + diff --git a/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml index 3c60448da..d845b2989 100644 --- a/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml index d509361be..8ec43dad6 100644 --- a/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -242,7 +236,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml index 9351e29b3..55a998c2d 100644 --- a/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml b/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml index c5a5b052c..c8088ade1 100644 --- a/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml @@ -18,20 +18,14 @@ Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - Expose value type to data entity - - + Reference to the dataset to which this observation belongs. - - - + @@ -107,7 +101,7 @@ --> - + The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. @@ -260,7 +254,7 @@ --> - + The geometry value of an observation (GeometryObservation) diff --git a/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml index 639b46212..4e4f99df6 100644 --- a/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml +++ b/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml @@ -58,7 +58,7 @@ - + diff --git a/mappings/src/main/resources/hibernate.cfg.xml b/mappings/src/main/resources/hibernate.cfg.xml index 156574689..0a809a412 100644 --- a/mappings/src/main/resources/hibernate.cfg.xml +++ b/mappings/src/main/resources/hibernate.cfg.xml @@ -8,6 +8,7 @@ org.hibernate.cache.NoCacheProvider 1 RECREATE_QUIETLY + true file:${user.home}/${project.build.finalName}.properties - 5.9.1 - 2.2 - 28.0 - 1.9.0 - 5.6.14.Final - 2.7.7 - 8.0.1 - - 42.5.1 - 2.5.1 - 21.8.0.0 - 11.2.1.jre8 - 8.0.30 - 2.1.214 - 0.9 - 11 + 6.1.0 + 3.0 + 35.0 + 1.12 + 6.0.2.Final + 3.2.0 + 2.0.18 + 3.0.0 + + 42.7.11 + 2025.1.1 + 2.4.240 + 17 ${maven.build.timestamp} yyyy ${maven.build.timestamp} UTF-8 + + 6.41.0 + 3.32.0 + 6.32.1 + 3.36.0 + 2.21.0 + 3.37.0 - org.hibernate + org.hibernate.orm hibernate-core ${hibernate.version} - org.hibernate + org.hibernate.orm hibernate-spatial ${hibernate.version} - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - import - pom - ${project.groupId} @@ -124,52 +118,42 @@ db-model-dialects ${project.version} - - org.postgresql - postgresql - ${postgresql.version} - - - net.postgis - postgis-jdbc - ${postgis.version} - - - com.oracle.database.jdbc - ojdbc8 - ${ojdbc8.version} - - - com.microsoft.sqlserver - mssql-jdbc - ${sqljdbc.version} - - - mysql - mysql-connector-java - ${mysql.version} - - - com.h2database - h2 - ${h2.version} - - - org.opengeo - geodb - ${geodb.version} - - - com.h2database - h2 - - - - - - javax - javaee-api - ${javax.version} + + org.postgresql + postgresql + ${postgresql.version} + + + net.postgis + postgis-jdbc + ${postgis.version} + + + com.h2database + h2 + ${h2.version} + + + + jakarta.platform + jakarta.jakartaee-api + 11.0.0 + + + jakarta.persistence + jakarta.persistence-api + 3.2.0 + + + jakarta.annotation + jakarta.annotation-api + 3.0.0 + provided + + + jakarta.el + jakarta.el-api + 6.0.1 @@ -181,18 +165,18 @@ com.google.code.findbugs jsr305 3.0.2 - + joda-time joda-time - 2.12.2 + 2.14.2 xalan xalan - 2.7.2 + 2.7.3 @@ -201,7 +185,7 @@ - + org.geotools gt-main @@ -281,7 +265,7 @@ org.locationtech.jts jts-core - 1.19.0 + 1.20.0 @@ -298,11 +282,50 @@ com.github.spotbugs spotbugs-annotations - 4.7.3 + 4.10.2 provided + + + ch.qos.logback + logback-core + 1.5.34 + + + org.slf4j + slf4j-api + ${version.slf4j} + + + org.slf4j + slf4j-simple + ${version.slf4j} + + + org.slf4j + jcl-over-slf4j + ${version.slf4j} + + + org.slf4j + slf4j-nop + ${version.slf4j} + + + + org.junit.jupiter + junit-jupiter-api + ${version.junit} + test + + + org.junit.jupiter + junit-jupiter-engine + ${version.junit} + test + org.junit junit-bom @@ -327,7 +350,16 @@ - + + org.codehaus.mojo + versions-maven-plugin + 2.7 + + + org.apache.commons:commons-collections4 + + + org.apache.maven.plugins maven-dependency-plugin @@ -446,13 +478,21 @@ true etc/license-as-csv.ftl - The Apache Software License, Version 2.0|Apache 2|Apache License, Version 2.0|Apache License, version 2.0|Apache Public License 2.0|AL 2.0 + The Apache Software License, Version 2.0|Apache 2|Apache License, Version + 2.0|Apache License, version 2.0|Apache Public License 2.0|AL 2.0 + Apache Software Licenses|Apache Software License|Apache License - GNU General Public License, v2.0|GNU GENERAL PUBLIC LICENSE Version 2, June 1991|GNU General Public License, Version 2.0 - Common Development and Distribution License (CDDL), version 1.0| Common Development and Distribution License (CDDL) v1.0 + GNU General Public License, v2.0|GNU GENERAL PUBLIC LICENSE Version 2, June + 1991|GNU General Public License, Version 2.0 + + Common Development and Distribution License (CDDL), version 1.0| Common + Development and Distribution License (CDDL) v1.0 + GNU Lesser General Public License, version 2.1|LGPL 2.1 Mozilla Public License version 1.1|MPL 1.1 - Eclipse Public License, Version 1.0|Eclipse Public License (EPL), Version 1.0|Eclipse Public License - v 1.0 + Eclipse Public License, Version 1.0|Eclipse Public License (EPL), Version + 1.0|Eclipse Public License - v 1.0 + GNU Lesser General Public Licence|LGPL @@ -482,6 +522,7 @@ import java.util.Date import java.text.MessageFormat + def vartimestamp = MessageFormat.format("{0,date,yyyy}", new Date()) project.properties['currentYearDynamic'] = vartimestamp @@ -593,7 +634,7 @@ dependency - + org.apache.maven.plugins maven-dependency-plugin @@ -602,7 +643,67 @@ none - + + + + + + + rewrite + + + + org.openrewrite.maven + rewrite-maven-plugin + ${version.rewrite.plugin} + + true + + org.n52.sos.MigrateToSpring6AndJakarta + + + + + + org.openrewrite.recipe + rewrite-spring + ${version.rewrite.spring} + + + org.openrewrite.recipe + rewrite-migrate-java + ${version.rewrite.migrate-java} + + + org.openrewrite.recipe + rewrite-hibernate + ${version.rewrite.hibernate} + + + org.openrewrite.recipe + rewrite-testing-frameworks + ${version.rewrite.testing-frameworks} + + + diff --git a/rewrite.yml b/rewrite.yml new file mode 100644 index 000000000..4aa377047 --- /dev/null +++ b/rewrite.yml @@ -0,0 +1,70 @@ +# +# OpenRewrite recipe configuration for the 52°North SOS upgrade to +# Spring Framework 6 / Spring Security 6 and the Jakarta EE (javax -> jakarta) +# namespace migration, including the Java 17 baseline that Spring 6 requires +# and the matching Hibernate 6 migration. +# +# This file is consumed by the 'rewrite' Maven profile (see pom.xml): +# +# mvn -Prewrite rewrite:dryRun # preview as target/rewrite/rewrite.patch +# mvn -Prewrite rewrite:run # apply changes in place +# +# Recipes are grouped so the migration can be run as a whole or step by step: +# point the profile's at one of the sub-recipes below +# (e.g. org.n52.sos.MigrateToJakarta) to run a single phase in isolation. +# +--- +type: specs.openrewrite.org/v1beta/recipe +name: org.n52.sos.MigrateToSpring6AndJakarta +displayName: Migrate SOS to Spring 6 and Jakarta EE +description: >- + Full migration of the 52°North SOS code base to Spring Framework 6, + Spring Security 6, Jakarta EE (javax -> jakarta) and Hibernate 6, on a + Java 17 baseline. Also applies JUnit 5 best practices to the test code. +recipeList: + # 1. Java 17 baseline (Spring 6 requires Java 17). Bumps the source/target + # level and applies the relevant language migrations. + - org.openrewrite.java.migrate.UpgradeToJava17 + + # 2. Jakarta EE namespace migration (javax.* -> jakarta.*) across servlet, + # persistence, validation, annotation, xml.bind, etc. + - org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta + + # 3. Spring Framework 6 (transitively migrates Spring's own javax usages, + # deprecated API replacements and configuration changes). + - org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_0 + + # 4. Spring Security 6 (this project uses spring-security heavily). + - org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_0 + + # 5. Hibernate 6.1 (moves to jakarta.persistence and the new Hibernate APIs). + - org.n52.sos.MigrateToHibernate + + # 6. JUnit 5 best practices for the test sources. + #- org.openrewrite.java.testing.junit5.JUnit5BestPractices + +--- +# +# Hibernate migration broken out so it can be run / reviewed on its own. +# Hibernate 6.1.x is the conservative landing target that pairs with +# Spring Framework 6.0; bump to MigrateToHibernate62+ later if desired. +# +type: specs.openrewrite.org/v1beta/recipe +name: org.n52.sos.MigrateToHibernate +displayName: Migrate SOS to Hibernate 6.1 +description: Migrate the Hibernate 5.6 usage in SOS to Hibernate 6.1.x. +recipeList: + - org.openrewrite.hibernate.MigrateToHibernate61 + +--- +# +# Jakarta-only phase (no Spring), useful for migrating the non-Spring modules +# (core, coding, hibernate, ...) first and reviewing them in isolation. +# +type: specs.openrewrite.org/v1beta/recipe +name: org.n52.sos.MigrateToJakarta +displayName: Migrate SOS to Jakarta EE +description: Migrate javax.* APIs in SOS to their jakarta.* equivalents. +recipeList: + - org.openrewrite.java.migrate.UpgradeToJava17 + - org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta diff --git a/test.py b/test.py new file mode 100644 index 000000000..d43b0fcb5 --- /dev/null +++ b/test.py @@ -0,0 +1,24 @@ +import glob, xml.etree.ElementTree as ET +from collections import Counter + +ATTR = {'property','many-to-one','one-to-one','set','bag','list','map', + 'component','dynamic-component','any','array','idbag'} +SUB = {'subclass','joined-subclass','union-subclass'} +local = lambda t: t.rsplit('}', 1)[-1] + +def walk(el, inherited, path, f): + names = [c.get('name') for c in el if local(c.tag) in ATTR and c.get('name')] + for n, k in Counter(names).items(): + if k > 1: + print(f"{f}: {path} declares '{n}' {k}x") + for n in sorted(set(names) & inherited): + print(f"{f}: {path} redeclares inherited '{n}'") + combined = inherited | set(names) + for c in el: + if local(c.tag) in SUB: + walk(c, combined, f"{path} > {c.get('name')}", f) + +for f in glob.glob('./mappings/src/main/hbm/**/*.hbm.xml', recursive=True): + for cls in ET.parse(f).getroot(): + if local(cls.tag) == 'class': + walk(cls, set(), cls.get('name'), f) \ No newline at end of file diff --git a/types/pom.xml b/types/pom.xml index 40e936ddd..d2476b615 100644 --- a/types/pom.xml +++ b/types/pom.xml @@ -12,7 +12,7 @@ - org.hibernate + org.hibernate.orm hibernate-core diff --git a/types/src/main/java/org/n52/hibernate/type/SmallBooleanType.java b/types/src/main/java/org/n52/hibernate/type/SmallBooleanType.java index 128d0c9f8..38800fa71 100644 --- a/types/src/main/java/org/n52/hibernate/type/SmallBooleanType.java +++ b/types/src/main/java/org/n52/hibernate/type/SmallBooleanType.java @@ -13,53 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.hibernate.type; -import java.io.Serializable; +package org.n52.hibernate.type; -import org.hibernate.dialect.Dialect; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.DiscriminatorType; -import org.hibernate.type.PrimitiveType; -import org.hibernate.type.descriptor.java.BooleanTypeDescriptor; -import org.hibernate.type.descriptor.sql.SmallIntTypeDescriptor; - -public class SmallBooleanType extends AbstractSingleColumnStandardBasicType - implements PrimitiveType, DiscriminatorType { - - public static final SmallBooleanType INSTANCE = new SmallBooleanType(); - - private static final long serialVersionUID = 5426388285620763702L; +import org.hibernate.type.descriptor.java.BooleanJavaType; +import org.hibernate.type.descriptor.jdbc.SmallIntJdbcType; - private String name = "small_boolean"; +public class SmallBooleanType extends AbstractSingleColumnStandardBasicType { public SmallBooleanType() { - super(new SmallIntTypeDescriptor(), BooleanTypeDescriptor.INSTANCE); + super(SmallIntJdbcType.INSTANCE, BooleanJavaType.INSTANCE); } @Override public String getName() { - return name; - } - - @Override - public Class getPrimitiveClass() { - return Boolean.class; - } - - @Override - public Serializable getDefaultValue() { - return Boolean.FALSE; - } - - @Override - public Boolean stringToObject(String string) { - return fromString(string); + return "small_boolean"; } - - @Override - public String objectToSQLString(Boolean value, Dialect dialect) { - return value ? "1" : "0"; - } - } From 8b8f627f3563f03d2b093c3c6cad2b3d9ab81717 Mon Sep 17 00:00:00 2001 From: speckij Date: Thu, 30 Jul 2026 18:20:02 +0200 Subject: [PATCH 2/3] [WIP] Hibernate 6 Migration Part 2 --- .gitignore | 4 + CLAUDE.md | 17 ++ entities/pom.xml | 19 +- .../db/beans/AbstractDatasetEntity.java | 63 ++++++ .../db/beans/AbstractFeatureEntity.java | 84 +++++++- .../db/beans/AbstractRelationEntity.java | 33 ++- .../n52/series/db/beans/BlobDataEntity.java | 13 ++ .../series/db/beans/BooleanDataEntity.java | 7 + .../series/db/beans/CategoryDataEntity.java | 7 + .../n52/series/db/beans/CategoryEntity.java | 30 +++ .../n52/series/db/beans/CodespaceEntity.java | 17 +- .../series/db/beans/ComplexDataEntity.java | 7 + .../series/db/beans/CompositeDataEntity.java | 3 + .../n52/series/db/beans/CountDataEntity.java | 6 + .../series/db/beans/DataArrayDataEntity.java | 18 +- .../org/n52/series/db/beans/DataEntity.java | 196 ++++++++++++------ .../n52/series/db/beans/DatasetEntity.java | 137 ++++++++++-- .../series/db/beans/DescribableEntity.java | 103 +++++---- .../n52/series/db/beans/FeatureEntity.java | 34 +++ .../org/n52/series/db/beans/FormatEntity.java | 12 ++ .../series/db/beans/GeometryDataEntity.java | 7 + .../series/db/beans/HierarchicalEntity.java | 8 +- .../org/n52/series/db/beans/IdEntity.java | 15 +- .../n52/series/db/beans/OfferingEntity.java | 138 +++++++++++- .../n52/series/db/beans/PhenomenonEntity.java | 72 ++++++- .../n52/series/db/beans/PlatformEntity.java | 85 +++++++- .../n52/series/db/beans/ProcedureEntity.java | 105 +++++++++- .../db/beans/ProcedureHistoryEntity.java | 39 +++- .../series/db/beans/ProfileDataEntity.java | 7 + .../series/db/beans/QuantityDataEntity.java | 6 + .../series/db/beans/ReferencedDataEntity.java | 7 + .../series/db/beans/RelatedDataEntity.java | 54 ++++- .../n52/series/db/beans/RelatedDataPK.java | 32 +++ .../series/db/beans/RelatedDatasetEntity.java | 50 ++++- .../n52/series/db/beans/RelatedDatasetPK.java | 31 +++ .../series/db/beans/RelatedFeatureEntity.java | 28 ++- .../series/db/beans/ResultTemplateEntity.java | 58 +++++- .../series/db/beans/SensorML20DataEntity.java | 10 + .../n52/series/db/beans/ServiceEntity.java | 42 +++- .../org/n52/series/db/beans/TagEntity.java | 33 ++- .../n52/series/db/beans/TextDataEntity.java | 11 + .../series/db/beans/TrajectoryDataEntity.java | 7 + .../org/n52/series/db/beans/UnitEntity.java | 16 ++ .../db/beans/VerticalMetadataEntity.java | 51 ++++- .../feature/AbstractMonitoringFeature.java | 4 + .../db/beans/feature/SpecimenEntity.java | 35 ++++ .../feature/wml/MonitoringPointEntity.java | 17 +- .../db/beans/i18n/AbstractI18nEntity.java | 27 +-- .../db/beans/i18n/I18nCategoryEntity.java | 15 +- .../series/db/beans/i18n/I18nDataEntity.java | 14 ++ .../db/beans/i18n/I18nDatasetEntity.java | 21 +- .../n52/series/db/beans/i18n/I18nEntity.java | 34 ++- .../db/beans/i18n/I18nFeatureEntity.java | 13 +- .../series/db/beans/i18n/I18nGroupEntity.java | 11 + .../db/beans/i18n/I18nLicenseEntity.java | 11 + .../db/beans/i18n/I18nLocationEntity.java | 15 ++ .../i18n/I18nMeasuringProgramEntity.java | 14 +- .../db/beans/i18n/I18nOfferingEntity.java | 13 +- .../series/db/beans/i18n/I18nPartyEntity.java | 11 + .../db/beans/i18n/I18nPhenomenonEntity.java | 14 +- .../db/beans/i18n/I18nPlatformEntity.java | 13 +- .../db/beans/i18n/I18nProcedureEntity.java | 15 ++ .../db/beans/i18n/I18nProjectEntity.java | 11 + .../db/beans/i18n/I18nSamplingEntity.java | 13 ++ .../db/beans/i18n/I18nServiceEntity.java | 1 - .../series/db/beans/i18n/I18nTagEntity.java | 12 +- .../series/db/beans/i18n/I18nUnitEntity.java | 11 + .../i18n/I18nVerticalMetadataEntity.java | 52 ++++- .../db/beans/parameter/ParameterEntity.java | 34 ++- .../parameter/TemporalParameterEntity.java | 15 +- .../DatasetBooleanParameterEntity.java | 24 ++- .../DatasetCategoryParameterEntity.java | 32 ++- .../DatasetComplexParameterEntity.java | 16 +- .../dataset/DatasetCountParameterEntity.java | 18 ++ .../dataset/DatasetJsonParameterEntity.java | 18 ++ .../dataset/DatasetParameterEntity.java | 44 +++- .../DatasetQuantityParameterEntity.java | 23 ++ .../DatasetTemporalParameterEntity.java | 7 + .../dataset/DatasetTextParameterEntity.java | 18 ++ .../dataset/DatasetXmlParameterEntity.java | 18 ++ .../FeatureBooleanParameterEntity.java | 17 ++ .../FeatureCategoryParameterEntity.java | 24 +++ .../FeatureComplexParameterEntity.java | 11 +- .../feature/FeatureCountParameterEntity.java | 18 ++ .../feature/FeatureJsonParameterEntity.java | 18 ++ .../feature/FeatureParameterEntity.java | 40 +++- .../FeatureQuantityParameterEntity.java | 23 ++ .../FeatureTemporalParameterEntity.java | 7 + .../feature/FeatureTextParameterEntity.java | 18 ++ .../feature/FeatureXmlParameterEntity.java | 18 ++ .../parameter/group/GroupParameterEntity.java | 11 + .../license/LicenseParameterEntity.java | 10 + .../LocationBooleanParameterEntity.java | 19 +- .../LocationCategoryParameterEntity.java | 24 +++ .../LocationComplexParameterEntity.java | 10 +- .../LocationCountParameterEntity.java | 18 ++ .../location/LocationJsonParameterEntity.java | 18 ++ .../location/LocationParameterEntity.java | 40 +++- .../LocationQuantityParameterEntity.java | 23 ++ .../LocationTemporalParameterEntity.java | 7 + .../location/LocationTextParameterEntity.java | 18 ++ .../location/LocationXmlParameterEntity.java | 18 ++ .../ObservationBooleanParameterEntity.java | 18 ++ .../ObservationCategoryParameterEntity.java | 24 +++ .../ObservationComplexParameterEntity.java | 11 +- .../ObservationCountParameterEntity.java | 18 ++ .../ObservationJsonParameterEntity.java | 18 ++ .../ObservationParameterEntity.java | 40 +++- .../ObservationQuantityParameterEntity.java | 23 ++ .../ObservationTemporalParameterEntity.java | 7 + .../ObservationTextParameterEntity.java | 18 ++ .../ObservationXmlParameterEntity.java | 18 ++ .../parameter/party/PartyParameterEntity.java | 10 + .../PhenomenonBooleanParameterEntity.java | 18 ++ .../PhenomenonCategoryParameterEntity.java | 24 +++ .../PhenomenonComplexParameterEntity.java | 10 +- .../PhenomenonCountParameterEntity.java | 18 ++ .../PhenomenonJsonParameterEntity.java | 18 ++ .../phenomenon/PhenomenonParameterEntity.java | 40 +++- .../PhenomenonQuantityParameterEntity.java | 23 ++ .../PhenomenonTemporalParameterEntity.java | 3 + .../PhenomenonTextParameterEntity.java | 18 ++ .../PhenomenonXmlParameterEntity.java | 18 ++ .../PlatformBooleanParameterEntity.java | 18 ++ .../PlatformCategoryParameterEntity.java | 24 +++ .../PlatformComplexParameterEntity.java | 10 +- .../PlatformCountParameterEntity.java | 18 ++ .../platform/PlatformJsonParameterEntity.java | 18 ++ .../platform/PlatformParameterEntity.java | 40 +++- .../PlatformQuantityParameterEntity.java | 23 ++ .../PlatformTemporalParameterEntity.java | 7 + .../platform/PlatformTextParameterEntity.java | 18 ++ .../platform/PlatformXmlParameterEntity.java | 18 ++ .../ProcedureBooleanParameterEntity.java | 18 ++ .../ProcedureCategoryParameterEntity.java | 24 +++ .../ProcedureComplexParameterEntity.java | 12 +- .../ProcedureCountParameterEntity.java | 18 ++ .../ProcedureJsonParameterEntity.java | 18 ++ .../procedure/ProcedureParameterEntity.java | 40 +++- .../ProcedureQuantityParameterEntity.java | 23 ++ .../ProcedureTemporalParameterEntity.java | 7 + .../ProcedureTextParameterEntity.java | 18 ++ .../ProcedureXmlParameterEntity.java | 18 ++ .../project/ProjectParameterEntity.java | 10 + .../relation/RelationParameterEntity.java | 10 + .../beans/sta/HistoricalLocationEntity.java | 50 ++++- .../series/db/beans/sta/LocationEntity.java | 66 ++++++ etc/db/postgresql/update_6x_7.sql | 18 ++ mappings/pom.xml | 9 - .../main/resources/orm/proxy/service.orm.xml | 29 +++ pom.xml | 15 +- 151 files changed, 3397 insertions(+), 391 deletions(-) create mode 100644 CLAUDE.md create mode 100644 entities/src/main/java/org/n52/series/db/beans/RelatedDataPK.java create mode 100644 entities/src/main/java/org/n52/series/db/beans/RelatedDatasetPK.java create mode 100644 etc/db/postgresql/update_6x_7.sql create mode 100644 mappings/src/main/resources/orm/proxy/service.orm.xml diff --git a/.gitignore b/.gitignore index 4a587ab0d..1876c424e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ codegen/console.log .idea/* *.iml *.checkstyle +.clawdea/REPO_STATE.md + +## local, credential-bearing config +db.properties diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..3cef15a4f --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,17 @@ +1. Ask, don't assume. If something is unclear, ask before writing a single line. Never make silent assumptions about intent, architecture, or requirements. When running unattended, pick the most reasonable interpretation, proceed, and record the assumption rather than blocking. + +2. Implement the simplest solution for simple problems, better solutions for harder problems. Do not over-engineer or add flexibility that isn't needed yet. + +3. Don't touch unrelated code but please do surface bad code or design smells you discover with me so we can address them as a separate issue. + +4. Flag uncertainty explicitly. If you're unsure about something, see point 1 above. If it makes sense to do so, conduct a small, localised and low-risk experiment and bring the hypothesis and results to me to discuss. Confidence without certainty causes more damage than admitting a gap. + +# Inline Comments + +- Use short comments to clarify non-obvious logic or business rules. +- Prefer comments above the line they explain. +- Mark decision points with `// decision:` and assumptions with `// assumption:` + +# Verification + +- Always ask the user for input from the user if uncertainties arise during implementation \ No newline at end of file diff --git a/entities/pom.xml b/entities/pom.xml index 26436717e..8d65ec690 100644 --- a/entities/pom.xml +++ b/entities/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.n52.sensorweb-server.db-model @@ -19,6 +20,10 @@ jakarta.persistence jakarta.persistence-api + + org.hibernate.orm + hibernate-core + joda-time @@ -59,6 +64,18 @@ hamcrest test + + + + org.postgresql + postgresql + test + + + org.hibernate.orm + hibernate-spatial + test + diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java index ce9201985..a9b7836e5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java @@ -24,7 +24,26 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.SQLRestriction; import org.locationtech.jts.geom.Geometry; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.dataset.DatasetParameterEntity; import org.n52.series.db.beans.sta.AbstractDatastreamEntity; import org.n52.series.db.beans.sta.LicenseEntity; import org.n52.series.db.beans.sta.PartyEntity; @@ -38,6 +57,41 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.AbstractDatasetEntity") +@Table(name = "dataset", + indexes = { @Index(name = "idx_dataset_identifier", columnList = "identifier"), + @Index(name = "idx_dataset_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_dataset_procedure", columnList = "fk_procedure_id"), + @Index(name = "idx_dataset_phenomenon", columnList = "fk_phenomenon_id"), + @Index(name = "idx_dataset_offering", columnList = "fk_offering_id"), + @Index(name = "idx_dataset_category", columnList = "fk_category_id"), + @Index(name = "idx_dataset_feature", columnList = "fk_feature_id"), + @Index(name = "idx_dataset_platform", columnList = "fk_platform_id"), + @Index(name = "idx_dataset_unit", columnList = "fk_unit_id"), + @Index(name = "idx_dataset_observation_type", columnList = "fk_format_id, observation_type"), + @Index(name = "idx_dataset_aggregation", columnList = "fk_aggregation_id"), + @Index(name = "idx_dataset_first_observation", columnList = "fk_first_observation_id"), + @Index(name = "idx_dataset_last_observation", columnList = "fk_last_observation_id"), + @Index(name = "idx_dataset_dataset_type", columnList = "dataset_type"), + @Index(name = "idx_dataset_value_type", columnList = "value_type"), + @Index(name = "idx_dataset_is_deleted", columnList = "is_deleted"), + @Index(name = "idx_dataset_is_disabled", columnList = "is_disabled"), + @Index(name = "idx_dataset_is_published", columnList = "is_published"), + @Index(name = "idx_dataset_is_mobile", columnList = "is_mobile"), + @Index(name = "idx_dataset_is_insitu", columnList = "is_insitu"), + @Index(name = "idx_dataset_is_hidden", columnList = "is_hidden"), + @Index(name = "idx_dataset_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_dataset_name_codespace", columnList = "fk_name_codespace_id"), + @Index(name = "idx_dataset_value_profile", columnList = "fk_value_profile_id") }, + uniqueConstraints = { @UniqueConstraint(name = "un_dataset_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_dataset_staIdentifier", columnNames = { "sta_identifier" }), + @UniqueConstraint(name = "un_dataset_identity", + columnNames = { "fk_procedure_id", "fk_phenomenon_id", "fk_offering_id", "fk_category_id", + "fk_feature_id", "fk_platform_id", "fk_unit_id" }) }) +// table comment: Storage of the dataset, the core table of the whole database model. +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "discriminator") +@AttributeOverride(name = "id", column = @Column(name = "dataset_id")) public class AbstractDatasetEntity extends DescribableEntity implements Serializable, HibernateRelations.IsStaEntity, AbstractDatastreamEntity, StaRelations.HasLicense, StaRelations.HasParty { @@ -88,6 +142,15 @@ public class AbstractDatasetEntity extends DescribableEntity private AbstractDatasetEntity aggregation; private boolean processed; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = DatasetParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_dataset_id", nullable = false, foreignKey = @ForeignKey(name = "fk_param_dataset_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } + public PhenomenonEntity getPhenomenon() { return phenomenon; } diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java index 591bcf37a..2858f6e6b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java @@ -13,22 +13,58 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import java.io.Serial; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; +package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.SQLRestriction; import org.locationtech.jts.geom.Geometry; import org.n52.series.db.beans.HibernateRelations.HasDatasets; import org.n52.series.db.beans.HibernateRelations.HasGeometry; import org.n52.series.db.beans.HibernateRelations.HasXml; import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nFeatureEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.feature.FeatureParameterEntity; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.AbstractFeatureEntity") +@Table(name = "feature", + indexes = { @Index(name = "idx_feature_format", columnList = "fk_format_id"), + @Index(name = "idx_feature_identifier", columnList = "identifier"), + @Index(name = "idx_feature_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_feature_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_feature_name_codespace", columnList = "fk_name_codespace_id") }, + uniqueConstraints = { @UniqueConstraint(name = "un_feature_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_feature_staIdentifier", columnNames = { "sta_identifier" }), + @UniqueConstraint(name = "un_feature_url", columnNames = { "url" }) }) +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "discriminator") +@AttributeOverride(name = "id", column = @Column(name = "feature_id")) public abstract class AbstractFeatureEntity extends HierarchicalEntity implements HasXml, HasGeometry, HasDatasets, IsStaEntity { @@ -41,13 +77,45 @@ public abstract class AbstractFeatureEntity extends HierarchicalEntity @Serial private static final long serialVersionUID = 6712642995944229067L; - private GeometryEntity geometryEntity; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_format_id", nullable = false, foreignKey = @ForeignKey(name = "fk_feature_format")) private FormatEntity featureType; - private String url; + + @Column(name = "xml", columnDefinition = "text") + // @Comment("The XML encoded representation of the feature.") private String xml; + + @Column(name = "url") + // @Comment("Optional URL to an external resource that describes the feature, e.g. a WFS") + private String url; + + @Embedded + private GeometryEntity geometryEntity; + + @OneToMany(mappedBy = DatasetEntity.PROPERTY_FEATURE, fetch = FetchType.LAZY, cascade = CascadeType.ALL, + orphanRemoval = true) private Set datasets; + private Set> observations; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = FeatureParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_feature_id", nullable = false, foreignKey = @ForeignKey(name = "fk_param_feature_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nFeatureEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_feature_id", nullable = false, foreignKey = @ForeignKey(name = "fk_feature")) + public Set> getTranslations() { + return super.getTranslations(); + } + @Override public GeometryEntity getGeometryEntity() { return geometryEntity; diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java index 0d9c8f7e0..3c85677de 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractRelationEntity.java @@ -15,53 +15,46 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.Column; +import jakarta.persistence.MappedSuperclass; + import java.io.Serial; -public abstract class AbstractRelationEntity extends IdEntity { +@MappedSuperclass +public abstract class AbstractRelationEntity { public static final String PROPERTY_ITEM = "item"; public static final String PROPERTY_RELATED_ITEM = "relatedItem"; - @Serial - private static final long serialVersionUID = -2573767006446257428L; - - private T item; - - private T relatedItem; - + @Column(name = "role") + // @Comment("Definition of the role of the relation") private String role; + @Column(name = "url") + // @Comment("URL that point to external information") private String relatedUrl; /** * @return the item */ - public T getItem() { - return item; - } + public abstract T getItem(); /** * @param item * the item to set */ - public void setItem(T item) { - this.item = item; - } + public abstract void setItem(T item); /** * @return the relatedItem */ - public T getRelatedItem() { - return relatedItem; - } + public abstract T getRelatedItem(); /** * @param relatedItem * the relatedItem to set */ - public void setRelatedItem(T relatedItem) { - this.relatedItem = relatedItem; - } + public abstract void setRelatedItem(T relatedItem); /** * @return the role diff --git a/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java index 21857cebf..b72744f30 100644 --- a/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java @@ -15,9 +15,22 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.PrimaryKeyJoinColumn; +import jakarta.persistence.SecondaryTable; + import java.io.Serial; import java.util.Collection; +@Entity(name = "org.n52.series.db.beans.BlobDataEntity") +@SecondaryTable(name = "value_blob", + pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_observation_id", + foreignKey = @ForeignKey(name = "fk_blob_value"))) +@DiscriminatorValue("blob") public class BlobDataEntity extends DataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java index 2a40cfa77..b7b5ff5cd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Collection; +@Entity(name = "org.n52.series.db.beans.BooleanDataEntity") +@DiscriminatorValue("bool") public class BooleanDataEntity extends DataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java index b629bc980..a79b9776d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Collection; +@Entity(name = "org.n52.series.db.beans.CategoryDataEntity") +@DiscriminatorValue("category") public class CategoryDataEntity extends DataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java index 04e122752..f8bee1c25 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java @@ -13,13 +13,43 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.n52.series.db.beans.i18n.I18nCategoryEntity; +import org.n52.series.db.beans.i18n.I18nEntity; + import java.io.Serial; +import java.util.Set; +@Entity(name = "org.n52.series.db.beans.CategoryEntity") +@Table(name = "category", indexes = @Index(name = "idx_category_identifier", columnList = "identifier"), + uniqueConstraints = @UniqueConstraint(name = "un_category_identifier", columnNames = { "identifier" })) +@AttributeOverride(name = "id", column = @Column(name = "category_id")) +@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) public class CategoryEntity extends DescribableEntity { @Serial private static final long serialVersionUID = -5508957540970020954L; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nCategoryEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_category_id", nullable = false, foreignKey = @ForeignKey(name = "fk_category")) + public Set> getTranslations() { + return super.getTranslations(); + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java b/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java index 2583a568d..5236b1dfb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java @@ -13,16 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.n52.series.db.beans.HibernateRelations.HasIdentifierCodespace; + import java.io.Serial; import java.io.Serializable; -import org.n52.series.db.beans.HibernateRelations.HasIdentifierCodespace; - /** * @since 1.0.0 */ +@Entity(name = "org.n52.series.db.beans.CodespaceEntity") +@Table(name = "codespace", + uniqueConstraints = @UniqueConstraint(name = "un_codespace_codespace", columnNames = { "name" })) public class CodespaceEntity extends IdEntity implements Serializable { public static final String PROPERTY_CODESPACE = HasIdentifierCodespace.IDENTIFIER_CODESPACE; @@ -32,6 +43,8 @@ public class CodespaceEntity extends IdEntity implements Serializable { @Serial private static final long serialVersionUID = 8795086004488469603L; + @Column(name = PROPERTY_NAME, nullable = false) + // @Comment("Name/definition of the codespace, e.g. of a domain") private String name; public String getName() { diff --git a/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java index 315e0f4fe..595695441 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Set; +@Entity(name = "org.n52.series.db.beans.ComplexDataEntity") +@DiscriminatorValue("complex") public class ComplexDataEntity extends CompositeDataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java index bbd1bc3cf..e16ffefdc 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java @@ -15,10 +15,13 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.MappedSuperclass; + import java.io.Serial; import java.util.Collection; import java.util.Set; +@MappedSuperclass public abstract class CompositeDataEntity extends DataEntity>> { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java index bd48d65db..d94d08471 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java @@ -20,9 +20,15 @@ import java.util.Collection; import java.util.List; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Entity(name = "org.n52.series.db.beans.CountDataEntity") +@DiscriminatorValue("count") public class CountDataEntity extends DataEntity implements NumericalDataEntity { private static final Logger LOGGER = LoggerFactory.getLogger(CountDataEntity.class); diff --git a/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java index 83328ab1b..1420e4abb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java @@ -19,17 +19,31 @@ import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.DataArrayDataEntity") +@DiscriminatorValue("dataarray") public class DataArrayDataEntity extends CompositeDataEntity { @Serial private static final long serialVersionUID = -1618516259763515255L; - private ResultTemplateEntity resultTemplate; - + @Column(name = "value_array", columnDefinition = "text") + // @Comment("The textual value of an observation (SweDataArrayObservation))") private String stringValue; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_result_template_id", foreignKey = @ForeignKey(name = "fk_result_template")) + private ResultTemplateEntity resultTemplate; + /** * @return the resultTemplate */ diff --git a/entities/src/main/java/org/n52/series/db/beans/DataEntity.java b/entities/src/main/java/org/n52/series/db/beans/DataEntity.java index b0ed29e68..901ed8185 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DataEntity.java @@ -25,6 +25,34 @@ import java.util.Objects; import java.util.Set; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.Transient; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.DiscriminatorOptions; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; +import org.hibernate.annotations.Formula; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.annotations.Type; +import org.hibernate.type.SqlTypes; import org.n52.series.db.beans.HibernateRelations.HasDataset; import org.n52.series.db.beans.HibernateRelations.HasFeature; import org.n52.series.db.beans.HibernateRelations.HasParameters; @@ -45,9 +73,34 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public abstract class DataEntity extends DescribableEntity implements Comparable>, Serializable, - HasPhenomenonTime, IsStaEntity, HasResultTime, HasValidTime, HasParameters, HasDataset, HasFeature, - IsProcessed, IsNoDataValue, StaRelations.HasGroups>, StaRelations.HasRelation> { +@Entity(name = "org.n52.series.db.beans.DataEntity") +@Table(name = "observation", + indexes = { @Index(name = "idx_observation_dataset", columnList = "fk_dataset_id"), + @Index(name = "idx_sampling_time_start", columnList = "sampling_time_start"), + @Index(name = "idx_sampling_time_end", columnList = "sampling_time_end"), + @Index(name = "idx_result_time", columnList = "result_time"), + @Index(name = "idx_observation_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_observation_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_observation_name_codespace", columnList = "fk_name_codespace_id"), + @Index(name = "idx_observation_is_deleted", columnList = "is_deleted"), + @Index(name = "idx_observation_parent", columnList = "fk_parent_observation_id"), + @Index(name = "idx_observation_result_template", columnList = "fk_result_template_id") }, + uniqueConstraints = { + @UniqueConstraint(name = "un_observation_identity", + columnNames = { "value_type", "fk_dataset_id", "sampling_time_start", "sampling_time_end", + "result_time", "vertical_from", "vertical_to" }), + @UniqueConstraint(name = "un_observation_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_observation_staIdentifier", columnNames = { "sta_identifier" }) }) +// table comment: Storage of the observation values with the timestamp and additional metadata. The metadata +// are height/depth values for profile observation and sampling geometries for trajectory observations. In +// each observation entry only one value_... column should be filled with a value! +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "value_type") +@DiscriminatorOptions(force = true) +@AttributeOverride(name = "id", column = @Column(name = "observation_id")) +public abstract class DataEntity extends DescribableEntity + implements Comparable>, Serializable, HasPhenomenonTime, IsStaEntity, HasResultTime, + HasValidTime, HasParameters, HasDataset, HasFeature, IsProcessed, IsNoDataValue { public static final String PROPERTY_DATASET = "dataset"; @@ -96,65 +149,115 @@ public abstract class DataEntity extends DescribableEntity implements Compara @Serial private static final long serialVersionUID = 273612846605300612L; + @Formula("value_type") + private String valueType; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_dataset_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset")) + private DatasetEntity dataset; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "sampling_time_start", nullable = false, length = 29) + // @Comment("The timestamp when the observation period has started or the observation took place. In the + // the latter, sampling_time_start and sampling_time_end are equal.") private Date samplingTimeStart; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "sampling_time_end", nullable = false, length = 29) + // @Comment("The timestamp when the measurement period has finished or the observation took place. In the + // the latter, sampling_time_start and sampling_time_end are equal.") private Date samplingTimeEnd; - private T value; - - private GeometryEntity geometryEntity; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "result_time", length = 29) + // @Comment("The timestamp when the observation was published. Might be identical with sampling_time_start + // and sampling_time_end.") + private Date resultTime; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_deleted", nullable = false) + @ColumnDefault("0") + // @Comment("Flag that indicates if this observation is deleted") private boolean deleted; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "valid_time_start", length = 29) + @ColumnDefault("NULL") + // @Comment("The timestamp from when the obervation is valid, e.g. forcaste observations") private Date validTimeStart; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "valid_time_end", length = 29) + @ColumnDefault("NULL") + // @Comment("The timestamp until when the obervation is valid, e.g. forcaste observations") private Date validTimeEnd; - private Date resultTime; - - private Long parent; - - private DatasetEntity dataset; - - private Long datasetId; - - private Set relatedObservations = new HashSet<>(0); + @Embedded + private GeometryEntity geometryEntity; - private String valueType; + @OneToMany(mappedBy = "observation", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) + private Set relatedObservations; + @Column(name = "value_identifier") + // @Comment("Identifier of the value. E.g. used in OGC SWE encoded values like SweText") private String valueIdentifier; + @Column(name = "value_name") + // @Comment("Identifier of the name. E.g. used in OGC SWE encoded values like SweText") private String valueName; + @Column(name = "value_description") + // @Comment("Identifier of the description. E.g. used in OGC SWE encoded values like SweText") private String valueDescription; + @Column(name = "vertical_from", nullable = false) + @ColumnDefault("0") + // @Comment("The start level of a vertical observation, required for profile observations") private BigDecimal verticalFrom = NOT_SET_VERTICAL; + @Column(name = "vertical_to", nullable = false) + @ColumnDefault("0") + // @Comment("The end level or the level of a vertical observation, required for profile observations") private BigDecimal verticalTo = NOT_SET_VERTICAL; - private DetectionLimitEntity detectionLimit; - - private SamplingProfileDataEntity samplingProfile; + @Column(name = "fk_parent_observation_id") + // @Comment("Reference to the parent observation in the case of complex observations like profiles, + // complex or swedataarray observations.") + private Long parent; + @Embedded private EReportingProfileDataEntity ereportingProfile; - private Boolean valueBoolean; + @Column(name = "value_quantity", insertable = false, updatable = false) + private BigDecimal valueQuantity; + @Column(name = "value_text", insertable = false, updatable = false) private String valueText; - private BigDecimal valueQuantity; + @Column(name = "value_count", insertable = false, updatable = false) + private Integer valueCount; + @Column(name = "value_category", insertable = false, updatable = false) private String valueCategory; - private Integer valueCount; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "value_boolean", insertable = false, updatable = false) + private Boolean valueBoolean; + @Transient + private T value; + + @Transient + private DetectionLimitEntity detectionLimit; + + @Transient + private SamplingProfileDataEntity samplingProfile; + + @Transient private AbstractFeatureEntity feature; + @Transient private Set> qualities = new LinkedHashSet<>(); - private Set subjects; - private Set objects; - private Set groups; - private boolean processed; /** @@ -294,14 +397,6 @@ public void setDataset(final DatasetEntity dataset) { this.dataset = dataset; } - public Long getDatasetId() { - return datasetId; - } - - public void setDatasetId(Long datasetId) { - this.datasetId = datasetId; - } - public Set getRelatedObservations() { return relatedObservations; } @@ -518,39 +613,6 @@ public boolean hasQuality() { return getQuality() != null && !getQuality().isEmpty(); } - @Override - public Set getSubjects() { - return subjects; - } - - @Override - public DataEntity setSubjects(Set subjects) { - this.subjects = subjects; - return this; - } - - @Override - public Set getObjects() { - return objects; - } - - @Override - public DataEntity setObjects(Set objects) { - this.objects = objects; - return this; - } - - @Override - public Set getGroups() { - return groups; - } - - @Override - public DataEntity setGroups(Set groups) { - this.groups = groups; - return this; - } - @Override public boolean isProcessed() { return processed; diff --git a/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java index 9ba05e384..a32166aea 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java @@ -13,10 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; -import org.n52.series.db.beans.HibernateRelations.HasTags; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OrderColumn; +import jakarta.persistence.Transient; +import org.hibernate.annotations.Check; +import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.Formula; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.type.SqlTypes; import org.joda.time.DateTimeZone; +import org.n52.series.db.beans.HibernateRelations.HasTags; import org.n52.series.db.beans.dataset.DatasetType; import org.n52.series.db.beans.dataset.ObservationType; import org.n52.series.db.beans.dataset.ValueType; @@ -29,9 +51,9 @@ import java.util.TimeZone; import java.util.stream.Collectors; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.DatasetEntity") +@DiscriminatorValue("null") public class DatasetEntity extends AbstractDatasetEntity implements HasTags { public static final String ENTITY_ALIAS = "dataset"; @@ -53,44 +75,123 @@ public class DatasetEntity extends AbstractDatasetEntity implements HasTags { @Serial private static final long serialVersionUID = -7491530543976690237L; - private boolean published = true; - - private boolean deleted; - - private boolean disabled; - + @Enumerated(EnumType.STRING) + @Column(name = "dataset_type", nullable = false) + @ColumnDefault("'not_initialized'") + @Check(constraints = "dataset_type in ('individualObservation', 'sampling', 'timeseries', 'profile', " + + "'trajectory', 'not_initialized')") + // @Comment("Indicator whether the dataset provides individualObservation (individual observations), + // timeseries + // (timeseries obervations) or trajectories (trajectory observations).") private DatasetType datasetType; + @Enumerated(EnumType.STRING) + @Column(name = "observation_type", nullable = false) + @ColumnDefault("'not_initialized'") + @Check(constraints = "observation_type in ('simple', 'profile', 'timeseries', 'trajectory', 'not_initialized')") + // @Comment("Indicator whether the dataset observations are of type simple (a simple observation, e.g. a + // scalar + // value like the temperature) or profile (profile observations)") private ObservationType observationType; + @Enumerated(EnumType.STRING) + @Column(name = "value_type", nullable = false) + @ColumnDefault("'not_initialized'") + @Check(constraints = "value_type in ('quantity', 'count', 'text', 'category', 'bool', 'geometry', 'blob', " + + "'reference', 'complex', 'dataarray', 'not_initialized')") + // @Comment("Indicator of the type of the single values. Valid values are quantity (scalar values), count + // (integer + // values), text (textual values), category (categorical values), bool (boolean values), reference + // (references, e + // .g. link to a source, photo, video)") private ValueType valueType; - private long observationCount = -1; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_deleted", nullable = false) + @ColumnDefault("0") + // @Comment("Flag that indicates if this dataset is deleted") + private boolean deleted; - private boolean hidden; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_disabled", nullable = false) + @ColumnDefault("0") + // @Comment("Flag that indicates if this dataset is disabled for insertion of new data") + private boolean disabled; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_published", nullable = false) + @ColumnDefault("1") + // @Comment("Flag that indicates if this dataset should be published") + private boolean published; + + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_mobile", nullable = false) + @ColumnDefault("0") + // @Comment("Flag that indicates if the procedure is mobile (1/true) or stationary (0/false).") private boolean mobile; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_insitu", nullable = false) + @ColumnDefault("1") + // @Comment("Flag that indicates if the procedure is insitu (1/true) or remote (0/false).") private boolean insitu = true; - private String originTimezone; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_hidden", nullable = false) + @ColumnDefault("0") + // @Comment("Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex + // datasets") + private boolean hidden; - private DateTimeZone timeZone; + @Column(name = "origin_timezone", length = 40) + // @Comment("Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id + // (CET) + // or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default.") + private String originTimezone; - private Set relatedDatasets; + @Column(name = "decimals") + // @Comment("Number of decimals that should be present in the output of the observation values. If no + // value is + // set, all decimals would be present.") + private Integer numberOfDecimals; + @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinTable(name = "dataset_reference", + joinColumns = @JoinColumn(name = "fk_dataset_id_from", nullable = false, + foreignKey = @ForeignKey(name = "fk_dataset_reference_from")), + inverseJoinColumns = @JoinColumn(name = "fk_dataset_id_to", nullable = false, + foreignKey = @ForeignKey(name = "fk_dataset_reference_to"))) + @OrderColumn(name = "sort_order") private List referenceValues; - private Integer numberOfDecimals; - + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_value_profile_id", foreignKey = @ForeignKey(name = "fk_value_profile")) private VerticalMetadataEntity verticalMetadata; - private SamplingProfileDatasetEntity samplingProfile; - + @JdbcTypeCode(SqlTypes.SMALLINT) + @Formula("1") private boolean ereportingProfile; + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "tag_dataset", + joinColumns = @JoinColumn(name = "fk_dataset_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_dataset_tag")), + inverseJoinColumns = @JoinColumn(name = "fk_tag_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_tag_dataset"))) private Set tags; + @Transient + private long observationCount = -1; + + @Transient + private DateTimeZone timeZone; + + @Transient + private Set relatedDatasets; + + @Transient + private SamplingProfileDatasetEntity samplingProfile; + public DatasetEntity() { this(DatasetType.not_initialized, ObservationType.not_initialized, ValueType.not_initialized); } diff --git a/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java b/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java index 6491a86e0..b190e8438 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java @@ -13,21 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Column; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Transient; +import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; + import java.io.Serial; import java.io.Serializable; import java.util.LinkedHashSet; import java.util.Objects; import java.util.Set; -import org.n52.series.db.beans.HibernateRelations.IsStaEntity; -import org.n52.series.db.beans.i18n.I18nEntity; -import org.n52.series.db.beans.parameter.ParameterEntity; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@MappedSuperclass public abstract class DescribableEntity extends IdEntity implements Describable, Serializable { public static final String PROPERTY_IDENTIFIER = IDENTIFIER; @@ -43,36 +51,47 @@ public abstract class DescribableEntity extends IdEntity implements Describable, @Serial private static final long serialVersionUID = -4448231483118864847L; - /** - * Identification of the entity without special chars. - */ + @Column(name = "identifier", nullable = false) + // @Comment("Unique identifier of the feature which is used for filtering. + // Should be a URI, UUID. E.g. http://www.example.org/123, 123-321") private String identifier; - /** - * Identification for SensorThings API of the entity without special chars. - */ + @Column(name = "sta_identifier", nullable = false) + // @Comment("Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI + // (reference to a vocabulary entry), UUID. E.g. 123, 123-321") private String staIdentifier; - private CodespaceEntity identifierCodespace; - /** - * Default name of the entity. - */ + @Column(name = "name") + // @Comment("The human readable name of the feature.") private String name; - private CodespaceEntity nameCodespace; - - /** - * Default description of the entity. - */ + @Column(name = "description", columnDefinition = "text") + // @Comment("A short description of the feature") private String description; - private ServiceEntity service; + //@ManyToOne(fetch = FetchType.LAZY) + //@JoinColumn(name = "fk_identifier_codespace_id", foreignKey = @ForeignKey(name = "fk_feature_identifier_codesp")) + //private CodespaceEntity identifierCodespace; - private Set> translations; + //@ManyToOne(fetch = FetchType.LAZY) + //@JoinColumn(name = "fk_name_codespace_id", foreignKey = @ForeignKey(name = "fk_feature_name_codespace")) + //private CodespaceEntity nameCodespace; + @Transient + // explictly mapped in subclasses private Set> parameters; + @Transient + // explictly mapped in subclasses + private Set> translations; + + // decision: not mapped here - only present in profiles/persistence-units that add the + // orm.xml override for this attribute (e.g. the "proxy" profile), since some deployments + // never had a service/fk_service_id column and must not gain one. + @Transient + private ServiceEntity service; + @Override public String getIdentifier() { return identifier; @@ -96,16 +115,6 @@ public void setStaIdentifier(String staIdentifier) { this.staIdentifier = staIdentifier; } - @Override - public CodespaceEntity getIdentifierCodespace() { - return this.identifierCodespace; - } - - @Override - public void setIdentifierCodespace(CodespaceEntity identifierCodespace) { - this.identifierCodespace = identifierCodespace; - } - @Override public String getName() { return name; @@ -116,15 +125,25 @@ public void setName(String name) { this.name = name; } - @Override - public CodespaceEntity getNameCodespace() { - return nameCodespace; - } - - @Override - public void setNameCodespace(CodespaceEntity nameCodespace) { - this.nameCodespace = nameCodespace; - } +// @Override +// public CodespaceEntity getIdentifierCodespace() { +// return this.identifierCodespace; +// } +// +// @Override +// public void setIdentifierCodespace(CodespaceEntity identifierCodespace) { +// this.identifierCodespace = identifierCodespace; +// } +// +// @Override +// public CodespaceEntity getNameCodespace() { +// return nameCodespace; +// } +// +// @Override +// public void setNameCodespace(CodespaceEntity nameCodespace) { +// this.nameCodespace = nameCodespace; +// } @Override public String getDescription() { diff --git a/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java index 20fdbe431..30914b33b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java @@ -15,11 +15,45 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; + import java.io.Serial; +import java.util.Set; +@Entity(name = "org.n52.series.db.beans.FeatureEntity") +@DiscriminatorValue("null") public class FeatureEntity extends AbstractFeatureEntity { @Serial private static final long serialVersionUID = 3926633318714623558L; + @Override + @ManyToMany(fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + @JoinTable(name = "feature_hierarchy", + joinColumns = @JoinColumn(name = "fk_child_feature_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_feature_child")), + inverseJoinColumns = @JoinColumn(name = "fk_parent_feature_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_feature_parent"))) + public Set getParents() { + return super.getParents(); + } + + @Override + @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + public Set getChildren() { + return super.getChildren(); + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java b/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java index 32a3a120c..636f7c87f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java @@ -15,8 +15,18 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; + import java.io.Serial; +@Entity(name = "org.n52.series.db.beans.FormatEntity") +@Table(name = "format", + uniqueConstraints = @UniqueConstraint(name = "un_format_definition", columnNames = { "definition" })) +@AttributeOverride(name = "id", column = @Column(name = "format_id")) public class FormatEntity extends IdEntity { public static final String FORMAT = "format"; @@ -24,6 +34,8 @@ public class FormatEntity extends IdEntity { @Serial private static final long serialVersionUID = -8428858401445365107L; + @Column(name = "definition", nullable = false) + // @Comment("The definition of the format.") private String format; public String getFormat() { diff --git a/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java index 838be0935..ba50fe1c1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Collection; +@Entity(name = "org.n52.series.db.beans.GeometryDataEntity") +@DiscriminatorValue("geometry") public class GeometryDataEntity extends DataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java b/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java index 37525bfd5..45ed14445 100644 --- a/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import java.io.Serial; import java.util.LinkedHashSet; import java.util.Set; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public abstract class HierarchicalEntity extends DescribableEntity { @@ -29,9 +30,8 @@ public abstract class HierarchicalEntity extends DescribableEntity { @Serial private static final long serialVersionUID = -530148269689996337L; - private Set children; - private Set parents; + private Set children; public void setChildren(Set children) { this.children = children; diff --git a/entities/src/main/java/org/n52/series/db/beans/IdEntity.java b/entities/src/main/java/org/n52/series/db/beans/IdEntity.java index 2a4de7428..aa4882898 100644 --- a/entities/src/main/java/org/n52/series/db/beans/IdEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/IdEntity.java @@ -13,14 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import org.n52.series.db.beans.HibernateRelations.HasId; + import java.io.Serial; import java.io.Serializable; import java.util.Objects; -import org.n52.series.db.beans.HibernateRelations.HasId; - +@MappedSuperclass public abstract class IdEntity implements Serializable, HasId { public static final String PROPERTY_ID = "id"; @@ -31,6 +38,10 @@ public abstract class IdEntity implements Serializable, HasId { /** * A serial primary key. */ + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = PROPERTY_ID, nullable = false, updatable = false) + // @Comment("PK column of the table") private Long id; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java b/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java index c638aefb0..b5c9211d7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java @@ -13,8 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; import org.locationtech.jts.geom.Geometry; import org.n52.series.db.beans.HibernateRelations.HasFeatureTypes; import org.n52.series.db.beans.HibernateRelations.HasObservationTypes; @@ -22,15 +42,23 @@ import org.n52.series.db.beans.HibernateRelations.HasRelatedFeatures; import org.n52.series.db.beans.HibernateRelations.HasResultTimes; import org.n52.series.db.beans.HibernateRelations.HasValidTime; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nOfferingEntity; import org.n52.series.db.common.Utils; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import java.io.Serial; import java.util.Date; import java.util.Set; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.OfferingEntity") +@Table(name = "offering", + indexes = { @Index(name = "idx_offering_identifier", columnList = "identifier"), + @Index(name = "idx_offering_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_offering_name_codespace", columnList = "fk_name_codespace_id") }, + uniqueConstraints = @UniqueConstraint(name = "un_offering_identifier", columnNames = { "identifier" })) +@AttributeOverride(name = "id", column = @Column(name = "offering_id")) +@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) public class OfferingEntity extends HierarchicalEntity implements HasObservationTypes, HasFeatureTypes, HasRelatedFeatures, HasPhenomenonTime, HasResultTimes, HasValidTime { @@ -42,26 +70,116 @@ public class OfferingEntity extends HierarchicalEntity implement @Serial private static final long serialVersionUID = 5862607025737865794L; - private GeometryEntity geometryEntity; - - private Set observationTypes; - - private Set featureTypes; - + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "sampling_time_start", length = 29) + // @Comment("The minimum samplingTimeStart of all observation that belong to this offering. If the column + // is + // empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of + // the SOS.") private Date phenomenonTimeStart; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "sampling_time_end", length = 29) + // @Comment("The maximum samplingTimeStart of all observation that belong to this offering. If the column + // is + // empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of + // the SOS.") private Date phenomenonTimeEnd; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "result_time_start", length = 29) + // @Comment("The minimum resultTimeStart of all observation that belong to this offering. If the column is + // empty, + // the information is calculated during the cache update and stored locally. Used for the capabilities of + // the SOS.") private Date resultTimeStart; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "result_time_end", length = 29) + // @Comment("The maximum resultTimeEnd of all observation that belong to this offering. If the column is + // empty, + // the information is calculated during the cache update and stored locally. Used for the capabilities of + // the SOS.") private Date resultTimeEnd; - private Set relatedFeatures; - + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "valid_time_start", length = 29) + // @Comment("The minimum validTimeStart of all observation that belong to this offering. If the column is + // empty, + // the information is calculated during the cache update and stored locally. Used for the capabilities of + // the SOS.") private Date validTimeStart; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "valid_time_end", length = 29) + // @Comment("The maximum validTimeEnd of all observation that belong to this offering. If the column is + // empty, the + // information is calculated during the cache update and stored locally. Used for the capabilities of the + // SOS.") private Date validTimeEnd; + @Embedded + private GeometryEntity geometryEntity; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "offering_observation_type", + joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_observation_type")), // points back at + // OfferingEntity + inverseJoinColumns = @JoinColumn(name = "fk_format_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_observation_type_offering")) // points at the target + ) + private Set observationTypes; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "offering_feature_type", + joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_feature_type")), // points back at + // OfferingEntity + inverseJoinColumns = @JoinColumn(name = "fk_format_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_feature_type_offering")) // points at the target + ) + private Set featureTypes; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "offering_related_feature", + joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_related_feature")), // points back at + // OfferingEntity + inverseJoinColumns = @JoinColumn(name = "fk_related_feature_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_related_feature_offering")) // points at the target + ) + private Set relatedFeatures; + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nOfferingEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_offering_id", nullable = false, foreignKey = @ForeignKey(name = "fk_offering")) + public Set> getTranslations() { + return super.getTranslations(); + } + + @Override + @ManyToMany(fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + @JoinTable(name = "offering_hierarchy", + joinColumns = @JoinColumn(name = "fk_child_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_child")), + inverseJoinColumns = @JoinColumn(name = "fk_parent_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_parent"))) + public Set getParents() { + return super.getParents(); + } + + @Override + @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + public Set getChildren() { + return super.getChildren(); + } + public Geometry getGeometry() { return geometryEntity != null ? geometryEntity.getGeometry() : null; } diff --git a/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java b/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java index c2758fd9f..4289ceda8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java @@ -13,25 +13,93 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +package org.n52.series.db.beans; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.SQLRestriction; +import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nPhenomenonEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.phenomenon.PhenomenonParameterEntity; import java.io.Serial; import java.util.Objects; import java.util.Set; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.PhenomenonEntity") +@Table(name = "phenomenon", + indexes = { @Index(name = "idx_phenomenon_identifier", columnList = "identifier"), + @Index(name = "idx_phenomenon_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_phenomenon_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_phenomenon_name_codespace", columnList = "fk_name_codespace_id") }, + uniqueConstraints = { @UniqueConstraint(name = "un_phenomenon_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_phenomenon_staIdentifier", columnNames = { "sta_identifier" }) }) +// table comment: Storage of the phenomenon/observableProperties, e.g. air temperature, water temperature, ... +@AttributeOverride(name = "id", column = @Column(name = "phenomenon_id")) public class PhenomenonEntity extends HierarchicalEntity implements HibernateRelations.HasAbstractDatasets, IsStaEntity { @Serial private static final long serialVersionUID = 2302654989683191424L; + @OneToMany(mappedBy = AbstractDatasetEntity.PROPERTY_PHENOMENON, fetch = FetchType.LAZY, cascade = CascadeType.ALL, + orphanRemoval = true) private Set datasets; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = PhenomenonParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_phenomenon_id", nullable = false, foreignKey = @ForeignKey(name = "fk_param_phenomenon_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nPhenomenonEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_phenomenon_id", nullable = false, foreignKey = @ForeignKey(name = "fk_phenomenon")) + public Set> getTranslations() { + return super.getTranslations(); + } + + @Override + @ManyToMany(fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + @JoinTable(name = "composite_phenomenon", + joinColumns = @JoinColumn(name = "fk_child_phenomenon_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_phenomenon_child")), + inverseJoinColumns = @JoinColumn(name = "fk_parent_phenomenon_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_phenomenon_parent"))) + public Set getParents() { + return super.getParents(); + } + + @Override + @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + public Set getChildren() { + return super.getChildren(); + } + @Override public void setDatasets(Set datastreams) { this.datasets = datastreams; diff --git a/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java b/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java index 9ca180d6e..e4ae0c5b1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java @@ -13,9 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.SQLRestriction; import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nPlatformEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.platform.PlatformParameterEntity; import org.n52.series.db.beans.sta.HistoricalLocationEntity; import org.n52.series.db.beans.sta.LocationEntity; import org.n52.series.db.beans.sta.PartyEntity; @@ -26,9 +49,18 @@ import java.util.LinkedHashSet; import java.util.Set; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.PlatformEntity") +@Table(name = "platform", + indexes = { @Index(name = "idx_platform_identifier", columnList = "identifier"), + @Index(name = "idx_platform_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_platform_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_platform_name_codespace", columnList = "fk_name_codespace_id"), + @Index(name = "idx_platfomr_assessment_type", columnList = "fk_assessment_type_id"), + @Index(name = "idx_platform_network", columnList = "fk_network_id") }, + uniqueConstraints = { @UniqueConstraint(name = "un_platform_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_platform_staIdentifier", columnNames = { "sta_identifier" }) }) +@AttributeOverride(name = "id", column = @Column(name = "platform_id")) public class PlatformEntity extends DescribableEntity implements HasLocations, IsStaEntity, HibernateRelations.HasAbstractDatasets, HibernateRelations.IsProcessed, HibernateRelations.HasParameters, HibernateRelations.HasNetwork, HibernateRelations.HasAssessmentType, StaRelations.HasParty { @@ -40,15 +72,62 @@ public class PlatformEntity extends DescribableEntity implements HasLocations locations; + + @OneToMany(fetch = FetchType.LAZY) + @JoinTable(name = "historical_location", + joinColumns = @JoinColumn(name = "fk_platform_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_platform_historical_location")), + inverseJoinColumns = @JoinColumn(name = "historical_location_id", nullable = false)) private Set historicalLocations; + + @OneToMany(mappedBy = DatasetEntity.PROPERTY_PLATFORM, fetch = FetchType.LAZY, cascade = CascadeType.ALL, + orphanRemoval = true) private Set datasets; + + // @ManyToOne(fetch = FetchType.LAZY) + // @JoinColumn(name = "fk_assessment_type_id", foreignKey = @ForeignKey(name = "fk_sp_assessment_type")) + @Transient + // not supported yet private AssessmentTypeEntity assessmentType; + + // @ManyToOne(fetch = FetchType.LAZY) + // @JoinColumn(name = "fk_network_id", foreignKey = @ForeignKey(name = "fk_sp_network")) + @Transient + // not supported yet private NetworkEntity network; + + @Transient + // not supported yet private PartyEntity party; + + @Transient + // not supported yet private boolean processed; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = PlatformParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_platform_id", nullable = false, foreignKey = @ForeignKey(name = "fk_param_platform_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nPlatformEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_platform_id", nullable = false, foreignKey = @ForeignKey(name = "fk_platform")) + public Set> getTranslations() { + return super.getTranslations(); + } + @Override public int hashCode() { return super.hashCode(); diff --git a/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java index 55f0370ce..a48ad87f9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java @@ -13,20 +13,56 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.annotations.SQLRestriction; +import org.hibernate.type.SqlTypes; import org.locationtech.jts.geom.Geometry; import org.n52.series.db.beans.HibernateRelations.HasGeometry; import org.n52.series.db.beans.HibernateRelations.HasProcedureDescriptionFormat; import org.n52.series.db.beans.HibernateRelations.HasProcedureHistory; import org.n52.series.db.beans.HibernateRelations.IsStaEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nProcedureEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.procedure.ProcedureParameterEntity; import java.io.Serial; import java.util.Set; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.ProcedureEntity") +@Table(name = "procedure", + indexes = { @Index(name = "idx_procedure_identifier", columnList = "identifier"), + @Index(name = "idx_procedure_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_procedure_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_procedure_name_codespace", columnList = "fk_name_codespace_id"), + @Index(name = "idx_procedure_is_reference", columnList = "is_reference"), + @Index(name = "idx_procedure_type_of", columnList = "fk_type_of_procedure_id"), + @Index(name = "idx_procedure_format", columnList = "fk_format_id") }, + uniqueConstraints = { @UniqueConstraint(name = "un_procedure_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_procedure_staIdentifier", columnNames = { "sta_identifier" }) }) +@AttributeOverride(name = "id", column = @Column(name = "procedure_id")) public class ProcedureEntity extends HierarchicalEntity implements HasProcedureHistory, HasProcedureDescriptionFormat, HasGeometry, HibernateRelations.HasAbstractDatasets, IsStaEntity { @@ -38,25 +74,76 @@ public class ProcedureEntity extends HierarchicalEntity impleme @Serial private static final long serialVersionUID = 4028002933920185756L; - private boolean reference; - - private FormatEntity format; + // Currently unmapped properties - might be required for some SOS Profiles private boolean deleted; + private GeometryEntity geometryEntity; + private boolean type; + @Column(name = "description_file", columnDefinition = "text") private String descriptionFile; - private ProcedureEntity typeOf; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_reference", nullable = false) + @ColumnDefault("0") + private boolean reference; - private boolean type; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_type_of_procedure_id", foreignKey = @ForeignKey(name = "fk_type_of")) + private ProcedureEntity typeOf; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_aggregation", nullable = false) + @ColumnDefault("1") private boolean aggregation; + @OneToMany(mappedBy = AbstractDatasetEntity.PROPERTY_PROCEDURE, fetch = FetchType.LAZY, cascade = CascadeType.ALL, + orphanRemoval = true) + private Set datasets; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_format_id", nullable = false, foreignKey = @ForeignKey(name = "fk_procedure_format")) + private FormatEntity format; + + @OneToMany(mappedBy = ProcedureHistoryEntity.PROPERTY_PROCEDURE, fetch = FetchType.LAZY, cascade = CascadeType.ALL, + orphanRemoval = true) private Set procedureHistory; - private GeometryEntity geometryEntity; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = ProcedureParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_procedure_id", nullable = false, foreignKey = @ForeignKey(name = "fk_param_procedure_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } - private Set datasets; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nProcedureEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_procedure_id", nullable = false, foreignKey = @ForeignKey(name = "fk_i18n_procedure")) + public Set> getTranslations() { + return super.getTranslations(); + } + + @Override + @ManyToMany(fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + @JoinTable(name = "procedure_hierarchy", + joinColumns = @JoinColumn(name = "fk_child_procedure_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_procedure_child")), + inverseJoinColumns = @JoinColumn(name = "fk_parent_procedure_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_procedure_parent"))) + public Set getParents() { + return super.getParents(); + } + + @Override + @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @Access(AccessType.PROPERTY) + public Set getChildren() { + return super.getChildren(); + } public boolean isReference() { return reference; diff --git a/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java index abdf9f00b..ec233287d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProcedureHistoryEntity.java @@ -19,6 +19,19 @@ import java.io.Serializable; import java.util.Date; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Lob; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import org.hibernate.annotations.ColumnDefault; import org.n52.series.db.beans.HibernateRelations.HasProcedure; import org.n52.series.db.beans.HibernateRelations.HasProcedureDescriptionFormat; import org.n52.series.db.beans.HibernateRelations.HasXml; @@ -30,6 +43,14 @@ * @since 1.0.0 */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.ProcedureHistoryEntity") +@Table(name = "procedure_history", + indexes = { @Index(name = "idx_procedure_history_procedure", columnList = "fk_procedure_id"), + @Index(name = "idx_procedure_history_format", columnList = "fk_format_id"), + @Index(name = "idx_start_time", columnList = "valid_from"), + @Index(name = "idx_end_time", columnList = "valid_to") }) +// table comment: Storage of historical procedure descriptions as XML encoded text with period of validity. +@AttributeOverride(name = "id", column = @Column(name = "procedure_history_id")) public class ProcedureHistoryEntity extends IdEntity implements Serializable, HasProcedure, HasProcedureDescriptionFormat, HasXml { @@ -40,14 +61,28 @@ public class ProcedureHistoryEntity extends IdEntity @Serial private static final long serialVersionUID = -3658568714438752174L; - private FormatEntity format; - + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_procedure_id", nullable = false, foreignKey = @ForeignKey(name = "fk_ph_procedure_id")) private ProcedureEntity procedure; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_format_id", nullable = false, foreignKey = @ForeignKey(name = "fk_pdf_id")) + private FormatEntity format; + + @Temporal(TemporalType.TIMESTAMP) // DELETE THIS LINE if the field is a java.time type + @Column(name = "valid_from", nullable = false, length = 29) + // @Comment("The timestamp from which this procedure description is valid.") private Date startTime; + @Temporal(TemporalType.TIMESTAMP) // DELETE THIS LINE if the field is a java.time type + @Column(name = "valid_to", length = 29) + @ColumnDefault("NULL") + // @Comment("The timestamp until this procedure description is valid. If null, this procedure description + // is currently valid") private Date endTime; + @Column(name = "xml", nullable = false, columnDefinition = "text") + // @Comment("XML representation of this procedure description") private String xml; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java index 84935afb9..2a043bb92 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Set; +@Entity(name = "org.n52.series.db.beans.ProfileDataEntity") +@DiscriminatorValue("profile") public class ProfileDataEntity extends CompositeDataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java index 6ed2feb27..b6aa4f0a0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java @@ -21,9 +21,15 @@ import java.util.Collection; import java.util.List; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Entity(name = "org.n52.series.db.beans.QuantityDataEntity") +@DiscriminatorValue("quantity") public class QuantityDataEntity extends DataEntity implements NumericalDataEntity { public static final BigDecimal DOUBLE_THRESHOLD = BigDecimal.valueOf(0.0001d); diff --git a/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java index 969cf33aa..996230984 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Collection; +@Entity(name = "org.n52.series.db.beans.ReferencedDataEntity") +@DiscriminatorValue("reference") public class ReferencedDataEntity extends DataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java index 2b272bc7b..f44a11961 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java @@ -15,11 +15,61 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.EmbeddedId; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MapsId; +import jakarta.persistence.Table; + import java.io.Serial; +@Entity(name = "org.n52.series.db.beans.RelatedDataEntity") +@Table(name = "related_observation", + indexes = { + @Index(name = "idx_related_observation_related_observation", columnList = "fk_related_observation_id"), + @Index(name = "idx_related_observation", columnList = "fk_observation_id") }) +// table comment: Store the relation of two observation, e.g. one observation depends on other observations to +// provide context +@AttributeOverride(name = "id", column = @Column(name = "procedure_id")) public class RelatedDataEntity extends AbstractRelationEntity> { - @Serial - private static final long serialVersionUID = 2436177373903826414L; + @EmbeddedId + private RelatedDataPK id = new RelatedDataPK(); + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @MapsId("relatedObservationId") + @JoinColumn(name = "fk_related_observation_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_rel_obs_related")) + private DataEntity relatedObservation; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @MapsId("observationId") + @JoinColumn(name = "fk_observation_id") + private DataEntity observation; + + @Override + public DataEntity getItem() { + return observation; + } + + @Override + public void setItem(DataEntity item) { + this.observation = item; + } + + @Override + public DataEntity getRelatedItem() { + return relatedObservation; + } + @Override + public void setRelatedItem(DataEntity relatedItem) { + this.relatedObservation = relatedItem; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDataPK.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDataPK.java new file mode 100644 index 000000000..96939b487 --- /dev/null +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDataPK.java @@ -0,0 +1,32 @@ +package org.n52.series.db.beans; + +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; + +import java.io.Serializable; +import java.util.Objects; + +@Embeddable +public class RelatedDataPK implements Serializable { + + @Column(name = "fk_observation_id") + private Long observationId; + + @Column(name = "fk_related_observation_id") + private Long relatedObservationId; + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + RelatedDataPK that = (RelatedDataPK) o; + return Objects.equals(observationId, that.observationId) + && Objects.equals(relatedObservationId, that.relatedObservationId); + } + + @Override + public int hashCode() { + return Objects.hash(observationId, relatedObservationId); + } +} \ No newline at end of file diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java index e0a9b862a..3ca3cb30c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetEntity.java @@ -13,13 +13,57 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; -import java.io.Serial; +import jakarta.persistence.EmbeddedId; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MapsId; +import jakarta.persistence.Table; +@Entity(name = "org.n52.series.db.beans.RelatedDatasetEntity") +@Table(name = "related_dataset", + indexes = @Index(name = "idx_related_dataset_related_dataset", columnList = "fk_related_dataset_id")) +// table comment: Store the relation of two datasets, e.g. one dataset depends on other datasets to provide +// context public class RelatedDatasetEntity extends AbstractRelationEntity { - @Serial - private static final long serialVersionUID = 280165490758286290L; + @EmbeddedId + private RelatedDatasetPK id = new RelatedDatasetPK(); + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @MapsId("relatedDatasetId") + @JoinColumn(name = "fk_related_dataset_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_rel_dataset_rel_dataset")) + private DatasetEntity relatedDataset; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @MapsId("datasetId") + @JoinColumn(name = "fk_dataset_id") + private DatasetEntity dataset; + + @Override + public DatasetEntity getItem() { + return dataset; + } + + @Override + public void setItem(DatasetEntity item) { + this.dataset = item; + } + + @Override + public DatasetEntity getRelatedItem() { + return relatedDataset; + } + @Override + public void setRelatedItem(DatasetEntity relatedItem) { + this.relatedDataset = relatedItem; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetPK.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetPK.java new file mode 100644 index 000000000..74283cff8 --- /dev/null +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDatasetPK.java @@ -0,0 +1,31 @@ +package org.n52.series.db.beans; + +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; + +import java.io.Serializable; +import java.util.Objects; + +@Embeddable +public class RelatedDatasetPK implements Serializable { + + @Column(name = "fk_dataset_id") + private Long datasetId; + + @Column(name = "fk_related_dataset_id") + private Long relatedDatasetId; + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + RelatedDatasetPK that = (RelatedDatasetPK) o; + return Objects.equals(datasetId, that.datasetId) && Objects.equals(relatedDatasetId, that.relatedDatasetId); + } + + @Override + public int hashCode() { + return Objects.hash(datasetId, relatedDatasetId); + } +} \ No newline at end of file diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java index 8debb0f39..6ea6ef13a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java @@ -20,6 +20,17 @@ import java.util.HashSet; import java.util.Set; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; import org.n52.series.db.beans.HibernateRelations.HasFeature; import org.n52.series.db.beans.HibernateRelations.HasOfferings; @@ -29,18 +40,29 @@ * @since 1.0.0 */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.RelatedFeatureEntity") +@Table(name = "related_feature", indexes = @Index(name = "idx_related_feature_feature", columnList = "fk_feature_id")) +// table comment: Storage of relations between offerings and features. This table is used by the SOS to +// fulfill the standard. +@AttributeOverride(name = "id", column = @Column(name = "related_feature_id")) public class RelatedFeatureEntity extends IdEntity implements Serializable, HasFeature, HasOfferings { public static final String PROPERTY_SERVICE = "service"; @Serial private static final long serialVersionUID = -8143897383050691280L; + @Transient + private ServiceEntity service; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_feature_id", nullable = false, foreignKey = @ForeignKey(name = "fk_related_feature")) private AbstractFeatureEntity feature; + @Column(name = "role", nullable = false) + // @Comment("The role of the related feature.") private String role; - private Set offerings = new HashSet<>(0); - - private ServiceEntity service; + @ManyToMany(fetch = FetchType.LAZY) + private Set offerings; public RelatedFeatureEntity() { } diff --git a/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java b/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java index e6927437f..b4d05de60 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java @@ -18,6 +18,16 @@ import java.io.Serial; import java.io.Serializable; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Lob; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.HibernateRelations.HasResultEncoding; import org.n52.series.db.beans.HibernateRelations.HasResultStructure; @@ -27,6 +37,17 @@ * @since 1.0.0 */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.ResultTemplateEntity") +@Table(name = "result_template", + indexes = { @Index(name = "idx_result_template_offering", columnList = "fk_offering_id"), + @Index(name = "idx_result_template_phenomenon", columnList = "fk_phenomenon_id"), + @Index(name = "idx_result_template_procedure", columnList = "fk_procedure_id"), + @Index(name = "idx_result_template_feature", columnList = "fk_feature_id"), + @Index(name = "idx_result_template_category", columnList = "fk_category_id"), + @Index(name = "idx_result_template_identifier", columnList = "identifier") }) +// table comment: Storage of templates for the result handling operations +@AttributeOverride(name = "id", column = @Column(name = "result_template_id")) + public class ResultTemplateEntity extends IdEntity implements Serializable, HasResultStructure, HasResultEncoding { public static final String PROPERTY_OFFERING = "offering"; @@ -44,27 +65,52 @@ public class ResultTemplateEntity extends IdEntity implements Serializable, HasR @Serial private static final long serialVersionUID = -8847952458819368733L; - private PhenomenonEntity phenomenon; + private String domain; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_result_template_offering")) private OfferingEntity offering; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_phenomenon_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_result_template_phenomenon")) + private PhenomenonEntity phenomenon; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_procedure_id", foreignKey = @ForeignKey(name = "fk_result_template_procedure")) private ProcedureEntity procedure; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_feature_id", foreignKey = @ForeignKey(name = "fk_result_template_feature")) private AbstractFeatureEntity feature; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_category_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_result_template_category")) private CategoryEntity category; + @Column(name = "identifier", nullable = false) + // @Comment("Unique identifier of the result template used for insertion operation") private String identifier; - private String domain; - + @Column(name = "structure", columnDefinition = "text") + // @Comment("The structure of the result template, should be a XML encoded swe:DataRecord") private String structure; + @Column(name = "encoding", columnDefinition = "text") + // @Comment("The encding of the result template, should be a XML encoded swe:TextEncoding") private String encoding; + @Column(name = "observation_structure", columnDefinition = "text") + // @Comment("The structure of the result template used for observations, should be a XML encoded + // swe:DataRecord") private String observationStructure; - private String observationsEncoding; + @Column(name = "observation_encoding", columnDefinition = "text") + // @Comment("The encding of the result template used for observations, should be a XML encoded + // swe:TextEncoding") + private String observationEncoding; public ResultTemplateEntity() { } @@ -194,11 +240,11 @@ public void setObservationStructure(String observationStructure) { } public String getObservationEncoding() { - return this.observationsEncoding; + return this.observationEncoding; } public void setObservationEncoding(String observationsEncoding) { - this.observationsEncoding = observationsEncoding; + this.observationEncoding = observationsEncoding; } public boolean isSetObservationEncoding() { diff --git a/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java b/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java index a6508c866..eae7f6aa4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java @@ -15,17 +15,27 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Lob; + import java.io.Serial; import java.util.Collection; /** * DataEntity with a measurement consisting of a SensorML, e.g. a SensorML event encoded in XML. */ +@Entity(name = "org.n52.series.db.beans.SensorML20DataEntity") +@DiscriminatorValue("sensorML20") public class SensorML20DataEntity extends DataEntity { @Serial private static final long serialVersionUID = 6575930482296453999L; + @Column(name = "value_array", columnDefinition = "text") + // @Comment("The XML representation of the SensorML20 Observation (SensorML20Observation)") private String value; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java b/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java index ee00693c4..a20575ad4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java @@ -24,9 +24,30 @@ import java.util.List; import java.util.Set; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Lob; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.annotations.Type; +import org.hibernate.type.SqlTypes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Entity(name = "org.n52.series.db.beans.ServiceEntity") +@Table(name = "service", + indexes = { @Index(name = "idx_service_identifier", columnList = "identifier"), + @Index(name = "idx_service_identifier_codespace", columnList = "fk_identifier_codespace_id"), + @Index(name = "idx_service_name_codespace", columnList = "fk_name_codespace_id") }, + uniqueConstraints = @UniqueConstraint(name = "un_service_identifier", columnNames = { "identifier" })) +// table comment: Storage of the service. +@AttributeOverride(name = "id", column = @Column(name = "service_id")) +@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) public class ServiceEntity extends DescribableEntity { @Serial @@ -34,20 +55,33 @@ public class ServiceEntity extends DescribableEntity { private static final Logger LOGGER = LoggerFactory.getLogger(ServiceEntity.class); + @Column(name = "url", columnDefinition = "text") + // @Comment("The url of the service") private String url; + @Column(name = "type") + // @Comment("The type of the service") private String type = "RESTful series data access layer."; - private List noDataValues = new LinkedList<>(); - + @Column(name = "version") + // @Comment("The version of the service") private String version; - private boolean supportsFirstLast = true; - + @Column(name = "connector") + // @Comment("The connector of the service.") private String connector; + @JdbcTypeCode(SqlTypes.SMALLINT) + @Column(name = "is_supports_first_last", nullable = false) + @ColumnDefault("1") + // @Comment("Flag that indicates if this service supports first/last observation queries") + private boolean supportsFirstLast; + + @Embedded private ServiceMetadataEntity serviceMetadata; + private List noDataValues = new LinkedList<>(); + private Set quantityNoDataValues = new LinkedHashSet<>(); private Set countNoDataValues = new LinkedHashSet<>(); diff --git a/entities/src/main/java/org/n52/series/db/beans/TagEntity.java b/entities/src/main/java/org/n52/series/db/beans/TagEntity.java index 43e6e4c5e..763db4527 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TagEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TagEntity.java @@ -18,18 +18,39 @@ import java.io.Serial; import java.util.Set; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import org.n52.series.db.beans.HibernateRelations.HasDatasets; import org.n52.series.db.beans.i18n.I18nEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.TagEntity") +@Table(name = "tag") +// table comment: Storage of the tags which should be used to tag the data. +@AttributeOverride(name = "id", column = @Column(name = "tag_id")) +@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) public class TagEntity extends DescribableEntity implements HasDatasets { @Serial private static final long serialVersionUID = 7851120161214727821L; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "tag_dataset", + joinColumns = @JoinColumn(name = "fk_tag_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_tag_dataset")), + inverseJoinColumns = @JoinColumn(name = "fk_dataset_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_dataset_tag"))) private Set datasets; - private Set> translations; @Override public String getName() { @@ -51,14 +72,4 @@ public void setDatasets(Set datasets) { this.datasets = datasets; } - @Override - public Set> getTranslations() { - return translations; - } - - @Override - public void setTranslations(Set> translations) { - this.translations = translations; - } - } diff --git a/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java index d6bf41a93..2c2561717 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java @@ -15,18 +15,29 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Transient; + import java.io.Serial; import java.util.Collection; +@Entity(name = "org.n52.series.db.beans.TextDataEntity") +@DiscriminatorValue("text") public class TextDataEntity extends DataEntity { @Serial private static final long serialVersionUID = 4925354534934095827L; + @Transient private String valueIdentifier; + @Transient private String valueName; + @Transient private String valueDescription; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java index 496cc2983..f39fd4237 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java @@ -15,9 +15,16 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + import java.io.Serial; import java.util.Set; +@Entity(name = "org.n52.series.db.beans.TrajectoryDataEntity") +@DiscriminatorValue("trajectory") public class TrajectoryDataEntity extends CompositeDataEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java b/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java index 0c20fa18e..8ce39dced 100644 --- a/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java @@ -13,10 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; + import java.io.Serial; +@Entity(name = "org.n52.series.db.beans.UnitEntity") +@Table(name = "unit", uniqueConstraints = @UniqueConstraint(name = "un_unit_symbol", columnNames = { "symbol" })) +// table comment: Storage of the units of measurement of the observation values. These may be °C or m as the +// unit for +// depth/height information. +@AttributeOverride(name = "id", column = @Column(name = "unit_id")) +@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) public class UnitEntity extends DescribableEntity { public static final String PROPERTY_UNIT = PROPERTY_IDENTIFIER; @@ -24,6 +38,8 @@ public class UnitEntity extends DescribableEntity { @Serial private static final long serialVersionUID = -7512483445911729980L; + @Column(name = "link") + // @Comment("Link/reference to an external description of the unit, e.g. to a vocabulary..") private String link; /** diff --git a/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java index 5af39d4a2..5b5f798aa 100644 --- a/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java @@ -13,16 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import java.io.Serial; -import java.util.Set; +package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import org.n52.series.db.beans.i18n.I18nVerticalMetadataEntity; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; +import java.util.Set; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.VerticalMetadataEntity") +@Table(name = "value_profile", + indexes = @Index(name = "idx_profile_vertical_unit", columnList = "fk_vertical_unit_id")) +@AttributeOverride(name = "id", column = @Column(name = "value_profile_id")) public class VerticalMetadataEntity extends IdEntity { public static final String PROPERTY_VERTICAL_UNIT = "verticalUnit"; @@ -33,16 +49,31 @@ public class VerticalMetadataEntity extends IdEntity { @Serial private static final long serialVersionUID = 3156288491348980598L; + @Column(name = "orientation", nullable = false) + // @Comment("The \"orientation\" of the vertical values as integer. 1 => above verticalOriginName and -1 + // => below + // verticalOriginName") // Hibernate 6.2+ private Short orientation; + @Column(name = "vertical_origin_name") + // @Comment("The vertical origin name of the vertical values, e.g. water surface") // Hibernate 6.2+ private String verticalOriginName; - private String verticalfromName; + @Column(name = "vertical_from_name") + // @Comment("The name of the vertical from values, e.g. from or depthFrom") // Hibernate 6.2+ + private String verticalFromName; - private String verticaltoName; + @Column(name = "vertical_to_name") + // @Comment("The name of the vertical from values, e.g. to or depthTo") // Hibernate 6.2+ + private String verticalToName; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_vertical_unit_id", nullable = false, foreignKey = @ForeignKey(name = "fk_profile_unit")) private UnitEntity verticalUnit; + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinTable(name = "value_profile_i18n", joinColumns = @JoinColumn(name = "fk_value_profile_id", nullable = false), + inverseJoinColumns = @JoinColumn(name = "value_profile_i18n_id", nullable = false)) private Set translations; public Short getOrientation() { @@ -78,11 +109,11 @@ public boolean isSetVerticalOriginName() { } public String getVerticalFromName() { - return verticalfromName; + return verticalFromName; } public void setVerticalFromName(String name) { - this.verticalfromName = name; + this.verticalFromName = name; } public boolean isSetVerticalFromName() { @@ -90,11 +121,11 @@ public boolean isSetVerticalFromName() { } public String getVerticalToName() { - return verticaltoName; + return verticalToName; } public void setVerticalToName(String name) { - this.verticaltoName = name; + this.verticalToName = name; } public boolean isSetVerticalToName() { diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java b/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java index 3ba00e1ba..6100765c9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/AbstractMonitoringFeature.java @@ -19,6 +19,8 @@ import java.util.Collection; import java.util.Collections; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Transient; import org.n52.series.db.beans.FeatureEntity; import org.n52.series.db.beans.feature.gmd.ResponsiblePartyEntity; import org.n52.series.db.beans.feature.gml.VerticalDatumEntity; @@ -32,11 +34,13 @@ * @since 1.0.0 */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@MappedSuperclass public abstract class AbstractMonitoringFeature extends FeatureEntity { @Serial private static final long serialVersionUID = 3379003106634935899L; + @Transient private MonitoringPointContent content; /** diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java index 3ca6f681a..f91878557 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java @@ -18,6 +18,18 @@ import java.io.Serial; import java.util.Date; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.PrimaryKeyJoinColumn; +import jakarta.persistence.SecondaryTable; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; import org.n52.series.db.beans.FeatureEntity; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.common.Utils; @@ -25,18 +37,41 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.feature.SpecimenEntity") +@SecondaryTable(name = "specimen", + pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_feature_id", + foreignKey = @ForeignKey(name = "fk_specimen_feature"))) +@DiscriminatorValue("SpecimenEntity") public class SpecimenEntity extends FeatureEntity { @Serial private static final long serialVersionUID = -1128862083434595324L; + @Column(name = "material_class", table = "specimen", nullable = false) private String materialClass; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "sampling_time_start", table = "specimen", nullable = false, length = 29) private Date samplingTimeStart; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "sampling_time_end", table = "specimen", nullable = false, length = 29) private Date samplingTimeEnd; + + @Column(name = "sampling_method", table = "specimen") private String samplingMethod; + + @Column(name = "specimen_size", table = "specimen") private Double size; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_size_unit_id", foreignKey = @ForeignKey(name = "fk_specimen_unit")) private UnitEntity sizeUnit; + + @Column(name = "current_location", table = "specimen") private String currentLocation; + + @Column(name = "specimen_type", table = "specimen") private String specimenType; /** diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java index b2866829f..3774c19b9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java @@ -13,18 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.feature.wml; -import java.io.Serial; +package org.n52.series.db.beans.feature.wml; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.PrimaryKeyJoinColumn; +import jakarta.persistence.SecondaryTable; import org.n52.series.db.beans.feature.AbstractMonitoringFeature; +import java.io.Serial; + /** * Hibernate entiity for the WaterML MonitoringPoint * * @author Carsten Hollmann * @since 1.0.0 */ +@Entity(name = "org.n52.series.db.beans.feature.wml.MonitoringPointEntity") +@SecondaryTable(name = "wml_monitoring_point", + pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_feature_id", + foreignKey = @ForeignKey(name = "fk_wml_monitoring_point"))) +@DiscriminatorValue("WmlMonitoringPointEntity") public class MonitoringPointEntity extends AbstractMonitoringFeature { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java index 656d493a9..b860f777f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/AbstractI18nEntity.java @@ -13,34 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.i18n; -import java.io.Serial; -import java.util.Objects; +package org.n52.series.db.beans.i18n; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Column; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MappedSuperclass; import org.n52.series.db.beans.IdEntity; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; +import java.util.Objects; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@MappedSuperclass public abstract class AbstractI18nEntity extends IdEntity { public static final String PROPERTY_LOCALE = "locale"; public static final String PROPERTY_ENTITY = "entity"; + @Serial private static final long serialVersionUID = -5046004232290585428L; - private T entity; - + @Column(name = "locale", nullable = false) private String locale; - public T getEntity() { - return entity; - } + public abstract T getEntity(); - public void setEntity(T entity) { - this.entity = entity; - } + public abstract void setEntity(T entity); public String getLocale() { return locale; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java index 30b7e95f6..8aa379af8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nCategoryEntity.java @@ -17,12 +17,23 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.Table; import org.n52.series.db.beans.CategoryEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nCategoryEntity") +@Table(name = "category_i18n", indexes = @Index(name = "idx_category_i18n_category", columnList = "fk_category_id")) +@AttributeOverride(name = "id", column = @Column(name = "category_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_category_id", nullable = false, insertable = false, updatable = false)) public class I18nCategoryEntity extends I18nEntity { @Serial private static final long serialVersionUID = -203423201673121632L; - - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java index b8cfc9d6c..9e427e509 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java @@ -17,15 +17,29 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.DataEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nDataEntity") +@Table(name = "observation_i18n", + indexes = @Index(name = "idx_observation_i18n_observation", columnList = "fk_observation_id")) +@AttributeOverride(name = "id", column = @Column(name = "observation_i18n_id")) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_observation_id", nullable = false)) public class I18nDataEntity extends I18nEntity> { @Serial private static final long serialVersionUID = 6049859871182587108L; + @Column(name = "value_name") private String valueName; + @Column(name = "value_description") private String valueDescription; public String getValueName() { diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java index 2283920c2..64ce47807 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java @@ -13,16 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.i18n; -import java.io.Serial; +package org.n52.series.db.beans.i18n; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; +import org.n52.series.db.beans.DatasetEntity; import org.n52.series.db.beans.DescribableEntity; -public class I18nDatasetEntity extends I18nEntity { +import java.io.Serial; + +@Entity(name = "org.n52.series.db.beans.i18n.I18nDatasetEntity") +@Table(name = "dataset_i18n", indexes = @Index(name = "idx_dataset_i18n_dataset", columnList = "fk_dataset_id")) +@AttributeOverride(name = "id", column = @Column(name = "dataset_i18n_id")) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_dataset_id", nullable = false)) +public class I18nDatasetEntity extends I18nEntity { @Serial private static final long serialVersionUID = -6806171135616112674L; - - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java index e77c84a41..59bee9cdb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java @@ -13,25 +13,38 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.i18n; -import java.io.Serial; +package org.n52.series.db.beans.i18n; +import jakarta.persistence.Column; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Lob; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MappedSuperclass; import org.n52.series.db.beans.DescribableEntity; -public class I18nEntity extends AbstractI18nEntity { - - public static final String PROPERTY_LOCALE = "locale"; +import java.io.Serial; - public static final String PROPERTY_ENTITY = "entity"; +@MappedSuperclass +public abstract class I18nEntity extends AbstractI18nEntity { @Serial private static final long serialVersionUID = 693520332508628558L; + @Column(name = "name") + // @Comment("Locale/language specific name of the location") private String name; + @Lob + @Column(name = "description") + // @Comment("Locale/language specific description of the location") private String description; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_entity_id", nullable = false) + private T entity; + public String getName() { return name; } @@ -56,4 +69,13 @@ public boolean hasDescription() { return getDescription() != null && !getDescription().isEmpty(); } + @Override + public T getEntity() { + return entity; + } + + @Override + public void setEntity(T entity) { + this.entity = entity; + } } \ No newline at end of file diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java index 881539367..b92d18d27 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nFeatureEntity.java @@ -17,12 +17,23 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.FeatureEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nFeatureEntity") +@Table(name = "feature_i18n", indexes = @Index(name = "idx_feature_i18n_feature", columnList = "fk_feature_id")) +@AttributeOverride(name = "id", column = @Column(name = "feature_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_feature_id", nullable = false, insertable = false, updatable = false)) public class I18nFeatureEntity extends I18nEntity { @Serial private static final long serialVersionUID = -4298562921888278009L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java index 047e42603..6af408f51 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nGroupEntity.java @@ -17,8 +17,19 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.sta.GroupEntity; +//@Entity(name = "org.n52.series.db.beans.i18n.I18nGroupEntity") +//@Table(name = "group_i18n", indexes = @Index(name = "idx_group_i18n_group", columnList = "fk_group_id")) +//@AttributeOverride(name = "id", column = @Column(name = "group_i18n_id")) +//@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_group_id", nullable = false)) public class I18nGroupEntity extends I18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java index 514e39842..94915b0fe 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLicenseEntity.java @@ -17,8 +17,19 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.sta.LicenseEntity; +//@Entity(name = "org.n52.series.db.beans.i18n.I18nLicenseEntity") +//@Table(name = "license_i18n", indexes = @Index(name = "idx_license_i18n_license", columnList = "fk_license_id")) +//@AttributeOverride(name = "id", column = @Column(name = "license_i18n_id")) +//@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_license_id", nullable = false)) public class I18nLicenseEntity extends I18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java index 230f17cc0..42ad2dd98 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nLocationEntity.java @@ -17,12 +17,27 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Lob; +import jakarta.persistence.Table; import org.n52.series.db.beans.sta.LocationEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nLocationEntity") +@Table(name = "location_i18n", indexes = @Index(name = "idx_location_i18n_location", columnList = "fk_location_id")) +@AttributeOverride(name = "id", column = @Column(name = "location_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_location_id", nullable = false, insertable = false, updatable = false)) public class I18nLocationEntity extends I18nEntity { @Serial private static final long serialVersionUID = 1667966645309819316L; + + @Column(name = "location", columnDefinition = "text") private String location; public String getLocation() { diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java index e759142a6..a1263cedc 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nMeasuringProgramEntity.java @@ -17,12 +17,24 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.sampling.MeasuringProgramEntity; +//@Entity(name = "org.n52.series.db.beans.i18n.I18nMeasuringProgramEntity") +//@Table(name = "measuring_program_i18n", +// indexes = @Index(name = "idx_measuring_program_i18n_measuring_program", +// columnList = "fk_measuring_program_id")) +//@AttributeOverride(name = "id", column = @Column(name = "measuring_program_i18n_id")) +//@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_measuring_program_id", nullable = false)) public class I18nMeasuringProgramEntity extends I18nEntity { @Serial private static final long serialVersionUID = 6723784868565645349L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java index f574fc8e5..d55b7ca66 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nOfferingEntity.java @@ -17,12 +17,23 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.OfferingEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nOfferingEntity") +@Table(name = "offering_i18n", indexes = @Index(name = "idx_offering_i18n_offering", columnList = "fk_offering_id")) +@AttributeOverride(name = "id", column = @Column(name = "offering_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, insertable = false, updatable = false)) public class I18nOfferingEntity extends I18nEntity { @Serial private static final long serialVersionUID = 6049859871182587108L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java index c774299c3..4a0d49c1c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPartyEntity.java @@ -17,8 +17,19 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.sta.PartyEntity; +//@Entity(name = "org.n52.series.db.beans.i18n.I18nPartyEntity") +//@Table(name = "party_i18n", indexes = @Index(name = "idx_party_i18n_party", columnList = "fk_party_id")) +//@AttributeOverride(name = "id", column = @Column(name = "party_i18n_id")) +//@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_party_id", nullable = false)) public class I18nPartyEntity extends I18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java index 15a4f25ac..5b7e97c99 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPhenomenonEntity.java @@ -17,12 +17,24 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.PhenomenonEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nPhenomenonEntity") +@Table(name = "phenomenon_i18n", + indexes = @Index(name = "idx_phenomenon_i18n_phenomenon", columnList = "fk_phenomenon_id")) +@AttributeOverride(name = "id", column = @Column(name = "phenomenon_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_phenomenon_id", nullable = false, insertable = false, updatable = false)) public class I18nPhenomenonEntity extends I18nEntity { @Serial private static final long serialVersionUID = 8139714432806062380L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java index e3f36b4fd..c273797e4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nPlatformEntity.java @@ -17,12 +17,23 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.PlatformEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nPlatformEntity") +@Table(name = "platform_i18n", indexes = @Index(name = "idx_platform_i18n_platform", columnList = "fk_platform_id")) +@AttributeOverride(name = "id", column = @Column(name = "platform_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_platform_id", nullable = false, insertable = false, updatable = false)) public class I18nPlatformEntity extends I18nEntity { @Serial private static final long serialVersionUID = -1921468522255863839L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java index 639c537cc..e5a0d9036 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProcedureEntity.java @@ -17,15 +17,30 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.ProcedureEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nProcedureEntity") +@Table(name = "procedure_i18n", + indexes = @Index(name = "idx_procedure_i18n_procedure", columnList = "fk_procedure_id")) +@AttributeOverride(name = "id", column = @Column(name = "procedure_i18n_id")) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_procedure_id", nullable = false, insertable = false, updatable = false)) public class I18nProcedureEntity extends I18nEntity { @Serial private static final long serialVersionUID = -7990237043788544558L; + @Column(name = "short_name") private String shortName; + @Column(name = "long_name") private String longName; public String getShortName() { diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java index 793d0a4df..2b431958e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nProjectEntity.java @@ -17,8 +17,19 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.sta.ProjectEntity; +//@Entity(name = "org.n52.series.db.beans.i18n.I18nProjectEntity") +//@Table(name = "project_i18n", indexes = @Index(name = "idx_project_i18n_project", columnList = "fk_project_id")) +//@AttributeOverride(name = "id", column = @Column(name = "project_i18n_id")) +//@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_project_id", nullable = false)) public class I18nProjectEntity extends I18nEntity { @Serial private static final long serialVersionUID = -1541904527369601026L; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java index a564a6eae..261bf3598 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nSamplingEntity.java @@ -17,15 +17,28 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.sampling.SamplingEntity; +//@Entity(name = "org.n52.series.db.beans.i18n.I18nSamplingEntity") +//@Table(name = "sampling_i18n", indexes = @Index(name = "idx_sampling_i18n_sampling", columnList = "fk_sampling_id")) +//@AttributeOverride(name = "id", column = @Column(name = "sampling_i18n_id")) +//@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_sampling_id", nullable = false)) public class I18nSamplingEntity extends I18nEntity { @Serial private static final long serialVersionUID = 6375003360445007130L; + @Column(name = "sampling_method") private String samplingMethod; + @Column(name = "environmental_conditions") private String environmentalConditions; /** diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java index 5144ddc86..c3804773d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nServiceEntity.java @@ -24,5 +24,4 @@ public class I18nServiceEntity extends I18nEntity { @Serial private static final long serialVersionUID = 3194966888990805278L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java index 81e6da1c1..d3a4521e1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java @@ -17,12 +17,22 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.TagEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nTagEntity") +@Table(name = "tag_i18n", indexes = @Index(name = "idx_tag_i18n_tag", columnList = "fk_tag_id")) +@AttributeOverride(name = "id", column = @Column(name = "tag_i18n_id")) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_tag_id", nullable = false)) public class I18nTagEntity extends I18nEntity { @Serial private static final long serialVersionUID = -203423201673121632L; - // serves for clear distinction } diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java index c64d8975f..1489f4a12 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java @@ -17,8 +17,19 @@ import java.io.Serial; +import jakarta.persistence.AssociationOverride; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Table; import org.n52.series.db.beans.UnitEntity; +@Entity(name = "org.n52.series.db.beans.i18n.I18nUnitEntity") +@Table(name = "unit_i18n", indexes = @Index(name = "idx_unit_i18n_unit", columnList = "fk_unit_id")) +@AttributeOverride(name = "id", column = @Column(name = "unit_i18n_id")) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_unit_id", nullable = false)) public class I18nUnitEntity extends I18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java index e4a831e23..40e3251fe 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java @@ -13,22 +13,47 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.i18n; -import java.io.Serial; +package org.n52.series.db.beans.i18n; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.VerticalMetadataEntity; +import java.io.Serial; + +@Entity(name = "org.n52.series.db.beans.i18n.I18nVerticalMetadataEntity") +@Table(name = "value_profile_i18n", + indexes = @Index(name = "idx_value_profile_i18n_value_profile", columnList = "fk_value_profile_id")) +@AttributeOverride(name = "id", column = @Column(name = "value_profile_i18n_id")) public class I18nVerticalMetadataEntity extends AbstractI18nEntity { @Serial private static final long serialVersionUID = 329570776993990200L; + @Column(name = "vertical_origin_name") + // @Comment("Locale/language specific vertical origin name of the vertical metadata entity") private String verticalOriginName; - private String verticalfromName; - private String verticaltoName; - public String getverticalOriginName() { + @Column(name = "vertical_from_name") + // @Comment("Locale/language specific verticalTo name of the vertical metadata entity") + private String verticalFromName; + + @Column(name = "vertical_to_name") + // @Comment("Locale/language specific verticalTo name of the vertical metadata entity") + private String verticalToName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_entity_id", nullable = false) + private VerticalMetadataEntity entity; + + public String getVerticalOriginName() { return verticalOriginName; } @@ -37,18 +62,27 @@ public void setVerticalOriginName(String name) { } public String getVerticalFromName() { - return verticalfromName; + return verticalFromName; } public void setVerticalFromName(String name) { - this.verticalfromName = name; + this.verticalFromName = name; } public String getVerticalToName() { - return verticaltoName; + return verticalToName; } public void setVerticalToName(String name) { - this.verticaltoName = name; + this.verticalToName = name; + } + + @Override + public VerticalMetadataEntity getEntity() { + return entity; + } + + public void setEntity(VerticalMetadataEntity entity) { + this.entity = entity; } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java index 7945a0612..b4810cd14 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java @@ -22,12 +22,19 @@ import java.util.Map; import java.util.Objects; +import jakarta.persistence.Column; +import jakarta.persistence.Lob; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.Transient; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.IdEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@MappedSuperclass public abstract class ParameterEntity extends IdEntity implements ValuedParameter, Comparable> { @@ -35,12 +42,27 @@ public abstract class ParameterEntity extends IdEntity @Serial private static final long serialVersionUID = -1489503368673412638L; + + @Column(name = "name", nullable = false) + // @Comment("The name of the parameter") private String name; + + @Column(name = "description", columnDefinition = "text") + // @Comment("A short description of the parameter") private String description; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "last_update") + // @Comment("Timestamp that provides the time of the last modification of this entry") private Date lastUpdate; + + @Column(name = "domain") + // @Comment("The domain this parameter belongs to.") private String domain; + + @Transient + // explictly mapped in subclasses private ParameterEntity parent; - private T value; public Map toValueMap(String locale) { Map valueMap = new HashMap<>(); @@ -110,16 +132,6 @@ public boolean hasParent() { return getParent() != null; } - @Override - public T getValue() { - return value; - } - - @Override - public void setValue(T value) { - this.value = value; - } - @Override public boolean isSetValue() { return getValue() != null; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/TemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/TemporalParameterEntity.java index 98fb6b7ec..e88053535 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/TemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/TemporalParameterEntity.java @@ -13,18 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.parameter; -import java.util.Date; +package org.n52.series.db.beans.parameter; import org.joda.time.DateTime; +import java.util.Date; + public interface TemporalParameterEntity extends ValuedParameter { default String asString(Date value) { return new DateTime(value).toString(); } + @Override + default TimeRange getValue() { + return null; + } + + @Override + default void setValue(TimeRange value) { + + } + @Override default String getValueAsString() { return getValue().isInstant() ? asString(getValue().getFrom()) diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java index 47001ecde..fd65d0f3a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetBooleanParameterEntity.java @@ -13,23 +13,41 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.parameter.dataset; -import java.io.Serial; +package org.n52.series.db.beans.parameter.dataset; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; +import java.io.Serial; + /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetBooleanParameterEntity") +@DiscriminatorValue("bool") public class DatasetBooleanParameterEntity extends DatasetParameterEntity implements BooleanParameterEntity { @Serial - private static final long serialVersionUID = -1280123654095577480L; + private static final long serialVersionUID = 3130389439734626025L; + + @Column(name = "value_boolean") + private Boolean value; @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java index 6ffbfb7d3..0ae7b9b04 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCategoryParameterEntity.java @@ -13,25 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.parameter.dataset; -import java.io.Serial; -import java.util.Map; +package org.n52.series.db.beans.parameter.dataset; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; +import java.util.Map; /** * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetCategoryParameterEntity") +@DiscriminatorValue("category") public class DatasetCategoryParameterEntity extends DatasetParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_dataset_param_unit")) private UnitEntity unit; @Override @@ -62,4 +76,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java index 5ecd9365a..ec522d6fd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetComplexParameterEntity.java @@ -13,14 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans.parameter.dataset; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import org.n52.series.db.beans.parameter.ComplexParameterEntity; + import java.io.Serial; import java.util.Set; import java.util.stream.Collectors; -import org.n52.series.db.beans.parameter.ComplexParameterEntity; - +//@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class DatasetComplexParameterEntity extends DatasetParameterEntity>> implements ComplexParameterEntity>> { @@ -29,12 +37,12 @@ public class DatasetComplexParameterEntity extends DatasetParameterEntity> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); + } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java index d53ace4ec..d60552395 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetCountParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetCountParameterEntity") +@DiscriminatorValue("count") public class DatasetCountParameterEntity extends DatasetParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java index 8a834f108..d86f1edef 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetJsonParameterEntity") +@DiscriminatorValue("json") public class DatasetJsonParameterEntity extends DatasetParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java index ea636c9e8..cd8ea85d1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java @@ -13,28 +13,54 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans.parameter.dataset; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.AbstractDatasetEntity; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.parameter.ParameterEntity; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import java.io.Serial; /** * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetParameterEntity") +@Table(name = "dataset_parameter", + indexes = { @Index(name = "idx_dataset_param_name", columnList = "name"), + @Index(name = "idx_dataset_parameter", columnList = "fk_dataset_id"), + @Index(name = "idx_dataset_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_dataset_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for platforms +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class DatasetParameterEntity extends ParameterEntity { public static final String PROP_DATASET = "dataset"; public static final String PROP_DATASET_ID = "datasetId"; + @Serial private static final long serialVersionUID = 8580995030975785255L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_dataset_id", nullable = false, insertable = false, updatable = false, + foreignKey = @ForeignKey(name = "fk_param_dataset_id")) private AbstractDatasetEntity dataset; - private Long datasetId; public AbstractDatasetEntity getDataset() { return dataset; @@ -44,12 +70,12 @@ public void setDataset(AbstractDatasetEntity dataset) { this.dataset = dataset; } - public Long getDatasetId() { - return datasetId; - } - - public void setDatasetId(Long observationId) { - this.datasetId = observationId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = DatasetParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_dataset_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java index 24b8018d6..6b6d2500d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetQuantityParameterEntity") +@DiscriminatorValue("quantity") public class DatasetQuantityParameterEntity extends DatasetParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -59,4 +72,14 @@ public void setUnit(final UnitEntity unit) { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java index 38efdc66e..c4b117fb8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTemporalParameterEntity.java @@ -17,9 +17,16 @@ import java.io.Serial; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class DatasetTemporalParameterEntity extends DatasetParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java index 9c4e85848..6811ac738 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetTextParameterEntity") +@DiscriminatorValue("text") public class DatasetTextParameterEntity extends DatasetParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java index 6738641d0..afe04900a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.dataset.DatasetXmlParameterEntity") +@DiscriminatorValue("xml") public class DatasetXmlParameterEntity extends DatasetParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java index 54af36a91..260c16681 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureBooleanParameterEntity.java @@ -17,19 +17,36 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureBooleanParameterEntity") +@DiscriminatorValue("bool") public class FeatureBooleanParameterEntity extends FeatureParameterEntity implements BooleanParameterEntity { @Serial private static final long serialVersionUID = -1280123654095577480L; + @Column(name = "value_boolean") + private Boolean value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java index 47f4bcd77..cbd6165a1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCategoryParameterEntity.java @@ -18,6 +18,13 @@ import java.io.Serial; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; @@ -27,11 +34,18 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureCategoryParameterEntity") +@DiscriminatorValue("category") public class FeatureCategoryParameterEntity extends FeatureParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_feature_param_unit")) private UnitEntity unit; @Override @@ -62,4 +76,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java index 965b0ec02..7560bdca6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureComplexParameterEntity.java @@ -19,8 +19,15 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.ComplexParameterEntity; +//@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class FeatureComplexParameterEntity extends FeatureParameterEntity>> implements ComplexParameterEntity>> { @@ -29,12 +36,12 @@ public class FeatureComplexParameterEntity extends FeatureParameterEntity> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); + } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java index 20eea0f08..b3a9525f5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureCountParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureCountParameterEntity") +@DiscriminatorValue("count") public class FeatureCountParameterEntity extends FeatureParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java index b3daa8a75..bb03f6f30 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureJsonParameterEntity") +@DiscriminatorValue("json") public class FeatureJsonParameterEntity extends FeatureParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java index c1f0fd440..32fd4da3d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureParameterEntity.java @@ -15,6 +15,19 @@ */ package org.n52.series.db.beans.parameter.feature; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.AbstractFeatureEntity; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -27,14 +40,27 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureParameterEntity") +@Table(name = "feature_parameter", + indexes = { @Index(name = "idx_feature_param_name", columnList = "name"), + @Index(name = "idx_feature_parameter", columnList = "fk_feature_id"), + @Index(name = "idx_feature_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_feature_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for features +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class FeatureParameterEntity extends ParameterEntity { public static final String PROP_FEATURE = "feature"; public static final String PROP_FEATURE_ID = "featureId"; + @Serial private static final long serialVersionUID = 1123453212836718013L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_feature_id", nullable = false, insertable = false, updatable = false, + foreignKey = @ForeignKey(name = "fk_param_feature_id")) private AbstractFeatureEntity feature; - private Long featureId; public AbstractFeatureEntity getFeature() { return feature; @@ -44,12 +70,12 @@ public void setFeature(AbstractFeatureEntity feature) { this.feature = feature; } - public Long getFeatureId() { - return featureId; - } - - public void setFeatureId(Long featureId) { - this.featureId = featureId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = FeatureParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_feature_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java index 2c65a62b5..34ad48916 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureQuantityParameterEntity") +@DiscriminatorValue("quantity") public class FeatureQuantityParameterEntity extends FeatureParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -59,4 +72,14 @@ public void setUnit(final UnitEntity unit) { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java index 0368a4d89..1038070e1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTemporalParameterEntity.java @@ -17,9 +17,16 @@ import java.io.Serial; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class FeatureTemporalParameterEntity extends FeatureParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java index cea911dd4..98035d406 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureTextParameterEntity") +@DiscriminatorValue("text") public class FeatureTextParameterEntity extends FeatureParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java index 65d3ca880..1276f9730 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/feature/FeatureXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.feature.FeatureXmlParameterEntity") +@DiscriminatorValue("xml") public class FeatureXmlParameterEntity extends FeatureParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java index b011898bc..f9c39d11c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/group/GroupParameterEntity.java @@ -17,6 +17,7 @@ import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.TimeRange; import org.n52.series.db.beans.sta.GroupEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -56,4 +57,14 @@ public void setGroupId(Long groupId) { public void setDescribeableEntity(DescribableEntity entity) { setGroup((GroupEntity) entity); } + + @Override + public T getValue() { + return null; + } + + @Override + public void setValue(T value) { + + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java index 9f73e56ec..756c6e902 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/license/LicenseParameterEntity.java @@ -56,4 +56,14 @@ public void setLicenseId(Long licenseId) { public void setDescribeableEntity(DescribableEntity entity) { setLicense((LicenseEntity) entity); } + + @Override + public T getValue() { + return null; + } + + @Override + public void setValue(T value) { + + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java index 77507e4ba..4fbbfde7a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationBooleanParameterEntity.java @@ -17,20 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationBooleanParameterEntity") +@DiscriminatorValue("bool") public class LocationBooleanParameterEntity extends LocationParameterEntity implements BooleanParameterEntity { @Serial - private static final long serialVersionUID = -1280123654095577480L; + private static final long serialVersionUID = 2288423133380587436L; + + @Column(name = "value_boolean") + private Boolean value; @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java index c9f324980..a10d98acd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCategoryParameterEntity.java @@ -18,6 +18,13 @@ import java.io.Serial; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; @@ -27,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationCategoryParameterEntity") +@DiscriminatorValue("category") public class LocationCategoryParameterEntity extends LocationParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_location_param_unit")) private UnitEntity unit; @Override @@ -63,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java index 2df33f2fa..66bd22fb7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationComplexParameterEntity.java @@ -19,8 +19,15 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.ComplexParameterEntity; +//@Entity(name = "org.n52.series.db.beans.parameter.location.LocationComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class LocationComplexParameterEntity extends LocationParameterEntity>> implements ComplexParameterEntity>> { @@ -29,12 +36,11 @@ public class LocationComplexParameterEntity extends LocationParameterEntity> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java index 17fab5170..979dfb049 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationCountParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationCountParameterEntity") +@DiscriminatorValue("count") public class LocationCountParameterEntity extends LocationParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java index 6c8ada947..5a1954e90 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationJsonParameterEntity") +@DiscriminatorValue("json") public class LocationJsonParameterEntity extends LocationParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java index 299bf92e9..ba9b8d82e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationParameterEntity.java @@ -15,6 +15,19 @@ */ package org.n52.series.db.beans.parameter.location; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.parameter.ParameterEntity; import org.n52.series.db.beans.sta.LocationEntity; @@ -27,14 +40,27 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationParameterEntity") +@Table(name = "location_parameter", + indexes = { @Index(name = "idx_location_param_name", columnList = "name"), + @Index(name = "idx_location_parameter", columnList = "fk_location_id"), + @Index(name = "idx_location_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_location_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for locations +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class LocationParameterEntity extends ParameterEntity { public static final String PROP_LOCATION = "location"; public static final String PROP_LOCATION_ID = "locationId"; + @Serial private static final long serialVersionUID = 8449960591522592006L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_location_id", nullable = false, insertable = false, updatable = false, + foreignKey = @ForeignKey(name = "fk_param_location_id")) private LocationEntity location; - private Long locationId; public LocationEntity getLocation() { return location; @@ -44,12 +70,12 @@ public void setLocation(LocationEntity location) { this.location = location; } - public Long getLocationId() { - return locationId; - } - - public void setLocationId(Long observationId) { - this.locationId = observationId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = LocationParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_location_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java index a3ba8a784..e05ee4400 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationQuantityParameterEntity") +@DiscriminatorValue("quantity") public class LocationQuantityParameterEntity extends LocationParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -59,4 +72,14 @@ public void setUnit(final UnitEntity unit) { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java index 01038a4d3..52a4fa889 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTemporalParameterEntity.java @@ -17,9 +17,16 @@ import java.io.Serial; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.location.LocationTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class LocationTemporalParameterEntity extends LocationParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java index dd7fc053b..d404944b7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationTextParameterEntity") +@DiscriminatorValue("text") public class LocationTextParameterEntity extends LocationParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java index c1fb7c8f7..f39e48d7d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/location/LocationXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.location.LocationXmlParameterEntity") +@DiscriminatorValue("xml") public class LocationXmlParameterEntity extends LocationParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java index 62e7eeddb..3df577cec 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationBooleanParameterEntity.java @@ -17,20 +17,38 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationBooleanParameterEntity") +@DiscriminatorValue("bool") public class ObservationBooleanParameterEntity extends ObservationParameterEntity implements BooleanParameterEntity { @Serial private static final long serialVersionUID = -1280123654095577480L; + @Column(name = "value_boolean") + private Boolean value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java index d3bf6ad6f..0f990a2be 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCategoryParameterEntity.java @@ -18,6 +18,13 @@ import java.io.Serial; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; @@ -27,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationCategoryParameterEntity") +@DiscriminatorValue("category") public class ObservationCategoryParameterEntity extends ObservationParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_observation_param_unit")) private UnitEntity unit; @Override @@ -63,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java index 4324fe44a..c8b563542 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationComplexParameterEntity.java @@ -19,8 +19,15 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.ComplexParameterEntity; +//@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class ObservationComplexParameterEntity extends ObservationParameterEntity>> implements ComplexParameterEntity>> { @@ -29,12 +36,12 @@ public class ObservationComplexParameterEntity extends ObservationParameterEntit @Override public Set> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); + } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java index 23ef6f2c8..6731700ba 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationCountParameterEntity.java @@ -17,20 +17,38 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationCountParameterEntity") +@DiscriminatorValue("count") public class ObservationCountParameterEntity extends ObservationParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java index c511e4347..7827e52d7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationJsonParameterEntity") +@DiscriminatorValue("json") public class ObservationJsonParameterEntity extends ObservationParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java index 8f58335b9..44e2b97de 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java @@ -15,6 +15,19 @@ */ package org.n52.series.db.beans.parameter.observation; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.DataEntity; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -27,14 +40,27 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationParameterEntity") +@Table(name = "observation_parameter", + indexes = { @Index(name = "idx_observation_param_name", columnList = "name"), + @Index(name = "idx_observation_parameter", columnList = "fk_observation_id"), + @Index(name = "idx_observation_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_observation_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for observations +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class ObservationParameterEntity extends ParameterEntity { public static final String PROP_OBSERVATION = "observation"; public static final String PROP_OBSERVATION_ID = "observationId"; + @Serial private static final long serialVersionUID = -3170715124801725482L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_observation_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_param_observation_id")) private DataEntity observation; - private Long observationId; public DataEntity getObservation() { return observation; @@ -44,12 +70,12 @@ public void setObservation(DataEntity observation) { this.observation = observation; } - public Long getObservationId() { - return observationId; - } - - public void setObservationId(Long observationId) { - this.observationId = observationId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = ObservationParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_observation_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java index 36072aa15..4ba494952 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationQuantityParameterEntity") +@DiscriminatorValue("quantity") public class ObservationQuantityParameterEntity extends ObservationParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -59,4 +72,14 @@ public void setUnit(final UnitEntity unit) { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java index e555bcffd..f37196ac7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTemporalParameterEntity.java @@ -17,9 +17,16 @@ import java.io.Serial; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class ObservationTemporalParameterEntity extends ObservationParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java index a05e9a2ff..aecd37800 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationTextParameterEntity") +@DiscriminatorValue("text") public class ObservationTextParameterEntity extends ObservationParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java index 10167c5dd..f5396f1f4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.observation.ObservationXmlParameterEntity") +@DiscriminatorValue("xml") public class ObservationXmlParameterEntity extends ObservationParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java index 77a8ef1cb..0bacf8986 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/party/PartyParameterEntity.java @@ -56,4 +56,14 @@ public void setPartyId(Long partyId) { public void setDescribeableEntity(DescribableEntity entity) { setParty((PartyEntity) entity); } + + @Override + public T getValue() { + return null; + } + + @Override + public void setValue(T value) { + + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java index ec0a8f2da..ed1cd38ee 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonBooleanParameterEntity.java @@ -17,20 +17,38 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonBooleanParameterEntity") +@DiscriminatorValue("bool") public class PhenomenonBooleanParameterEntity extends PhenomenonParameterEntity implements BooleanParameterEntity { @Serial private static final long serialVersionUID = -1280123654095577480L; + @Column(name = "value_boolean") + private Boolean value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java index a08ca2f56..54b54e866 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCategoryParameterEntity.java @@ -18,6 +18,13 @@ import java.io.Serial; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; @@ -27,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonCategoryParameterEntity") +@DiscriminatorValue("category") public class PhenomenonCategoryParameterEntity extends PhenomenonParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_phenomenon_param_unit")) private UnitEntity unit; @Override @@ -63,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java index bca049eef..af2ce13ac 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonComplexParameterEntity.java @@ -19,8 +19,15 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.ComplexParameterEntity; +//@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class PhenomenonComplexParameterEntity extends PhenomenonParameterEntity>> implements ComplexParameterEntity>> { @@ -29,12 +36,11 @@ public class PhenomenonComplexParameterEntity extends PhenomenonParameterEntity< @Override public Set> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java index d26557b13..431a1cecd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonCountParameterEntity.java @@ -17,20 +17,38 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonCountParameterEntity") +@DiscriminatorValue("count") public class PhenomenonCountParameterEntity extends PhenomenonParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java index f83ca7e5c..4385fd671 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonJsonParameterEntity") +@DiscriminatorValue("json") public class PhenomenonJsonParameterEntity extends PhenomenonParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java index 9337fa3aa..2f2866195 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonParameterEntity.java @@ -15,6 +15,19 @@ */ package org.n52.series.db.beans.parameter.phenomenon; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.PhenomenonEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -27,14 +40,27 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonParameterEntity") +@Table(name = "phenomenon_parameter", + indexes = { @Index(name = "idx_phenomenon_param_name", columnList = "name"), + @Index(name = "idx_phenomenon_parameter", columnList = "fk_phenomenon_id"), + @Index(name = "idx_phenomenon_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_phenomenon_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for phenomenons +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class PhenomenonParameterEntity extends ParameterEntity { public static final String PROP_PHENOMENON = "phenomenon"; public static final String PROP_PHENOMENON_ID = "phenomenonId"; + @Serial private static final long serialVersionUID = 5234864540316301294L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_phenomenon_id", nullable = false, insertable = false, updatable = false, + foreignKey = @ForeignKey(name = "fk_param_phenomenon_id")) private PhenomenonEntity phenomenon; - private Long phenomenonId; public PhenomenonEntity getPhenomenon() { return phenomenon; @@ -44,12 +70,12 @@ public void setPhenomenon(PhenomenonEntity phenomenon) { this.phenomenon = phenomenon; } - public Long getPhenomenonId() { - return phenomenonId; - } - - public void setPhenomenonId(Long observationId) { - this.phenomenonId = observationId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = PhenomenonParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_phenomenon_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java index 7c1f4f793..99c8d8ea8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonQuantityParameterEntity") +@DiscriminatorValue("quantity") public class PhenomenonQuantityParameterEntity extends PhenomenonParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -59,4 +72,14 @@ public void setUnit(final UnitEntity unit) { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java index bb3dcef47..2cad354b4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTemporalParameterEntity.java @@ -20,6 +20,9 @@ import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class PhenomenonTemporalParameterEntity extends PhenomenonParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java index 19d4d949f..e81e32a13 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonTextParameterEntity") +@DiscriminatorValue("text") public class PhenomenonTextParameterEntity extends PhenomenonParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java index fb2fa2728..6e8f5962b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/phenomenon/PhenomenonXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.phenomenon.PhenomenonXmlParameterEntity") +@DiscriminatorValue("xml") public class PhenomenonXmlParameterEntity extends PhenomenonParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java index c401831d2..800e6ccce 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformBooleanParameterEntity.java @@ -17,20 +17,38 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformBooleanParameterEntity") +@DiscriminatorValue("bool") public class PlatformBooleanParameterEntity extends PlatformParameterEntity implements BooleanParameterEntity { @Serial private static final long serialVersionUID = -1280123654095577480L; + @Column(name = "value_boolean") + private Boolean value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java index 49b1a020a..5ce28a6a2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCategoryParameterEntity.java @@ -18,6 +18,13 @@ import java.io.Serial; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; @@ -27,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformCategoryParameterEntity") +@DiscriminatorValue("category") public class PlatformCategoryParameterEntity extends PlatformParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_platform_param_unit")) private UnitEntity unit; @Override @@ -63,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java index 3b535b423..7b2ea7266 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformComplexParameterEntity.java @@ -19,8 +19,15 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.ComplexParameterEntity; +//@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class PlatformComplexParameterEntity extends PlatformParameterEntity>> implements ComplexParameterEntity>> { @@ -29,12 +36,11 @@ public class PlatformComplexParameterEntity extends PlatformParameterEntity> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java index a7235b77d..5e234c942 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformCountParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformCountParameterEntity") +@DiscriminatorValue("count") public class PlatformCountParameterEntity extends PlatformParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java index e0bae8da2..243961ff6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformJsonParameterEntity") +@DiscriminatorValue("json") public class PlatformJsonParameterEntity extends PlatformParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java index 434eb13e8..5c91cf7c6 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformParameterEntity.java @@ -15,6 +15,19 @@ */ package org.n52.series.db.beans.parameter.platform; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.PlatformEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -27,14 +40,27 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformParameterEntity") +@Table(name = "platform_parameter", + indexes = { @Index(name = "idx_platform_param_name", columnList = "name"), + @Index(name = "idx_platform_parameter", columnList = "fk_platform_id"), + @Index(name = "idx_platform_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_platform_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for platforms +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class PlatformParameterEntity extends ParameterEntity { public static final String PROP_PLATFORM = "platform"; public static final String PROP_PLATFORM_ID = "platformId"; + @Serial private static final long serialVersionUID = -8427939633323086462L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_platform_id", nullable = false, insertable = false, updatable = false, + foreignKey = @ForeignKey(name = "fk_param_platform_id")) private PlatformEntity platform; - private Long platformId; public PlatformEntity getPlatform() { return platform; @@ -44,12 +70,12 @@ public void setPlatform(PlatformEntity platform) { this.platform = platform; } - public Long getPlatformId() { - return platformId; - } - - public void setPlatformId(Long platformId) { - this.platformId = platformId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = PlatformParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_platform_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java index fd4098179..909708ac1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformQuantityParameterEntity") +@DiscriminatorValue("quantity") public class PlatformQuantityParameterEntity extends PlatformParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -64,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java index bb723c1dd..3c9c84a0e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTemporalParameterEntity.java @@ -17,9 +17,16 @@ import java.io.Serial; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class PlatformTemporalParameterEntity extends PlatformParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java index cf6d1b244..a606ce3ea 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformTextParameterEntity") +@DiscriminatorValue("text") public class PlatformTextParameterEntity extends PlatformParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java index 525853e4e..b29cb488d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/platform/PlatformXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.platform.PlatformXmlParameterEntity") +@DiscriminatorValue("xml") public class PlatformXmlParameterEntity extends PlatformParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java index c958f9b58..63d7ab404 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureBooleanParameterEntity.java @@ -17,20 +17,38 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.BooleanParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureBooleanParameterEntity") +@DiscriminatorValue("bool") public class ProcedureBooleanParameterEntity extends ProcedureParameterEntity implements BooleanParameterEntity { @Serial private static final long serialVersionUID = -1280123654095577480L; + @Column(name = "value_boolean") + private Boolean value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java index 974002caf..9d24a838e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCategoryParameterEntity.java @@ -18,6 +18,13 @@ import java.io.Serial; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.CategoryParameterEntity; @@ -27,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureCategoryParameterEntity") +@DiscriminatorValue("category") public class ProcedureCategoryParameterEntity extends ProcedureParameterEntity implements CategoryParameterEntity { @Serial private static final long serialVersionUID = -6262887605542676492L; + @Column(name = "value_category") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_procedure_param_unit")) private UnitEntity unit; @Override @@ -63,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return getValue(); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java index 98a84863c..ed458e421 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureComplexParameterEntity.java @@ -19,22 +19,28 @@ import java.util.Set; import java.util.stream.Collectors; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.ComplexParameterEntity; +//@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureComplexParameterEntity") +//@DiscriminatorValue("complex") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class ProcedureComplexParameterEntity extends ProcedureParameterEntity>> implements ComplexParameterEntity>> { @Serial - private static final long serialVersionUID = -5166758396873257962L; + private static final long serialVersionUID = 6058606080700304098L; @Override public Set> getValue() { - return super.getValue(); + return null; } @Override public void setValue(Set> value) { - super.setValue(value); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java index 996436670..3e643f3ef 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureCountParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.CountParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureCountParameterEntity") +@DiscriminatorValue("count") public class ProcedureCountParameterEntity extends ProcedureParameterEntity implements CountParameterEntity { @Serial private static final long serialVersionUID = -7778025481981408886L; + @Column(name = "value_count") + private Integer value; + @Override public String getValueAsString() { return isSetValue() ? getValue().toString() : null; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java index f9b0b9671..8c637b86f 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureJsonParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.JsonParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureJsonParameterEntity") +@DiscriminatorValue("json") public class ProcedureJsonParameterEntity extends ProcedureParameterEntity implements JsonParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_json") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java index ccbf656ce..ab6500949 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureParameterEntity.java @@ -15,6 +15,19 @@ */ package org.n52.series.db.beans.parameter.procedure; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.ProcedureEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -27,14 +40,27 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureParameterEntity") +@Table(name = "procedure_parameter", + indexes = { @Index(name = "idx_procedure_param_name", columnList = "name"), + @Index(name = "idx_procedure_parameter", columnList = "fk_procedure_id"), + @Index(name = "idx_procedure_parent_parameter", columnList = "fk_parent_parameter_id"), + @Index(name = "idx_procedure_parameter_unit", columnList = "fk_unit_id") }) +// table comment: Storage for additional information for procedures +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type") public abstract class ProcedureParameterEntity extends ParameterEntity { public static final String PROP_PROCEDURE = "procedure"; public static final String PROP_PROCEDURE_ID = "procedureId"; + @Serial private static final long serialVersionUID = -3203271103169023133L; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_procedure_id", nullable = false, insertable = false, updatable = false, + foreignKey = @ForeignKey(name = "fk_param_procedure_id")) private ProcedureEntity procedure; - private Long procedureId; public ProcedureEntity getProcedure() { return procedure; @@ -44,12 +70,12 @@ public void setProcedure(ProcedureEntity procedure) { this.procedure = procedure; } - public Long getProcedureId() { - return procedureId; - } - - public void setProcedureId(Long procedureId) { - this.procedureId = procedureId; + @Override + @Access(AccessType.PROPERTY) + @ManyToOne(targetEntity = ProcedureParameterEntity.class, fetch = FetchType.LAZY) + @JoinColumn(name = "fk_parent_parameter_id", foreignKey = @ForeignKey(name = "fk_param_procedure_parent_id")) + public ParameterEntity getParent() { + return super.getParent(); } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java index 01e9393e4..fe4fd450c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureQuantityParameterEntity.java @@ -19,6 +19,12 @@ import java.math.BigDecimal; import java.util.Map; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import org.n52.series.db.beans.UnitEntity; import org.n52.series.db.beans.parameter.QuantityParameterEntity; @@ -28,12 +34,19 @@ * @author Jan Speckamp */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureQuantityParameterEntity") +@DiscriminatorValue("quantity") public class ProcedureQuantityParameterEntity extends ProcedureParameterEntity implements QuantityParameterEntity { @Serial private static final long serialVersionUID = 7528516075676290716L; + @Column(name = "value_quantity") + private BigDecimal value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id") private UnitEntity unit; @Override @@ -64,4 +77,14 @@ public boolean isSetUnit() { public String getValueAsString() { return isSetValue() ? getValue().toPlainString() : null; } + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java index 6a4fcd876..d97e90183 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTemporalParameterEntity.java @@ -17,9 +17,16 @@ import java.io.Serial; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TemporalParameterEntity; import org.n52.series.db.beans.parameter.TimeRange; +//@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureTemporalParameterEntity") +//@DiscriminatorValue("temporal") +//@AttributeOverride(name = "value", column = @Column(name = "TODO")) public class ProcedureTemporalParameterEntity extends ProcedureParameterEntity implements TemporalParameterEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java index eacbe559f..bc7737368 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureTextParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.TextParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureTextParameterEntity") +@DiscriminatorValue("text") public class ProcedureTextParameterEntity extends ProcedureParameterEntity implements TextParameterEntity { @Serial private static final long serialVersionUID = 3300965770609382377L; + @Column(name = "value_text") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java index c2cb0f716..414dfd470 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/procedure/ProcedureXmlParameterEntity.java @@ -17,19 +17,37 @@ import java.io.Serial; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; import org.n52.series.db.beans.parameter.XmlParameterEntity; /** * @author Jan Speckamp */ +@Entity(name = "org.n52.series.db.beans.parameter.procedure.ProcedureXmlParameterEntity") +@DiscriminatorValue("xml") public class ProcedureXmlParameterEntity extends ProcedureParameterEntity implements XmlParameterEntity { @Serial private static final long serialVersionUID = 1209102870245642049L; + @Column(name = "value_xml") + private String value; + @Override public String getValueAsString() { return getValue(); } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java index ca8f8735a..e5213a88d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/project/ProjectParameterEntity.java @@ -56,4 +56,14 @@ public void setProjectId(Long projectId) { public void setDescribeableEntity(DescribableEntity entity) { setProject((ProjectEntity) entity); } + + @Override + public T getValue() { + return null; + } + + @Override + public void setValue(T value) { + + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java index 9747a8fdb..78daa9119 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/relation/RelationParameterEntity.java @@ -58,4 +58,14 @@ public void setRelationId(Long relationId) { public void setDescribeableEntity(DescribableEntity entity) { setRelation((RelationEntity) entity); } + + @Override + public T getValue() { + return null; + } + + @Override + public void setValue(T value) { + + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java index 3594f26b2..fe18977c9 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java @@ -13,8 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans.sta; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.IdEntity; @@ -28,11 +44,19 @@ import java.util.Objects; import java.util.Set; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - /** * @author Sebastian Drost */ +@Entity(name = "org.n52.series.db.beans.sta.HistoricalLocationEntity") +@Table(name = "historical_location", + indexes = { @Index(name = "idx_historicallocation_identifier", columnList = "identifier"), + @Index(name = "idx_historicalLocation_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_historical_location_platform", columnList = "fk_platform_id") }, + uniqueConstraints = { + @UniqueConstraint(name = "un_historicallocation_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_historicalLocation_staIdentifier", columnNames = { "sta_identifier" }) }) +@AttributeOverride(name = "id", column = @Column(name = "historical_location_id")) + @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) public class HistoricalLocationEntity extends DescribableEntity implements Serializable, HasLocations, HibernateRelations.IsProcessed, HibernateRelations.HasThing { @@ -46,11 +70,17 @@ public class HistoricalLocationEntity extends DescribableEntity implements Seria @Serial private static final long serialVersionUID = 5564686026419270062L; - private Date time; + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_platform_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_platform_historical_location")) + private PlatformEntity platform; - private Set locationEntities; + @ManyToMany(fetch = FetchType.LAZY) + private Set locations; - private PlatformEntity platformEntity; + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "time", nullable = false, length = 29) + private Date time; private boolean processed; @@ -65,23 +95,23 @@ public HistoricalLocationEntity setTime(Date time) { @Override public Set getLocations() { - return locationEntities; + return locations; } @Override public HistoricalLocationEntity setLocations(Set locationEntities) { - this.locationEntities = locationEntities; + this.locations = locationEntities; return this; } @Override public PlatformEntity getPlatform() { - return platformEntity; + return platform; } @Override - public void setPlatform(PlatformEntity platformEntity) { - this.platformEntity = platformEntity; + public void setPlatform(PlatformEntity platform) { + this.platform = platform; } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java index 5d1e9d168..d789a13f0 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java @@ -15,7 +15,27 @@ */ package org.n52.series.db.beans.sta; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.Lob; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import org.hibernate.annotations.SQLRestriction; import org.locationtech.jts.geom.Geometry; +import org.n52.series.db.beans.Describable; import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.FormatEntity; import org.n52.series.db.beans.GeometryEntity; @@ -24,6 +44,10 @@ import org.n52.series.db.beans.PlatformEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nLocationEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.location.LocationParameterEntity; import java.io.Serial; import java.io.Serializable; @@ -35,6 +59,14 @@ */ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Entity(name = "org.n52.series.db.beans.sta.LocationEntity") +@Table(name = "location", + indexes = { @Index(name = "idx_location_identifier", columnList = "identifier"), + @Index(name = "idx_location_staIdentifier", columnList = "sta_identifier"), + @Index(name = "idx_location_format", columnList = "fk_format_id") }, + uniqueConstraints = { @UniqueConstraint(name = "un_location_identifier", columnNames = { "identifier" }), + @UniqueConstraint(name = "un_location_staIdentifier", columnNames = { "sta_identifier" }) }) +@AttributeOverride(name = "id", column = @Column(name = "location_id")) public class LocationEntity extends DescribableEntity implements Serializable, HasGeometry, HibernateRelations.HasName, HibernateRelations.HasDescription, HibernateRelations.IsProcessed, StaRelations.HasPlatforms, StaRelations.HasHistoricalLocations { @@ -47,11 +79,45 @@ public class LocationEntity extends DescribableEntity implements Serializable, H @Serial private static final long serialVersionUID = -8201429072560300649L; + @Column(name = "location", columnDefinition = "text") private String location; + + @Embedded private GeometryEntity geometryEntity; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_format_id", nullable = false, foreignKey = @ForeignKey(name = "fk_location_format")) private FormatEntity locationEncoding; + + @ManyToMany(fetch = FetchType.LAZY) + // TODO mappedBy = "" private Set platforms; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "location_historical_location", + joinColumns = @JoinColumn(name = "fk_location_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_location_historical_loc")), + inverseJoinColumns = @JoinColumn(name = "fk_historical_location_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_historical_loc_location"))) private Set historicalLocations; + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = LocationParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_location_id", nullable = false, foreignKey = @ForeignKey(name = "fk_param_location_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nLocationEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_location_id", nullable = false, foreignKey = @ForeignKey(name = "fk_location")) + public Set> getTranslations() { + return super.getTranslations(); + } + private boolean processed; public FormatEntity getLocationEncoding() { diff --git a/etc/db/postgresql/update_6x_7.sql b/etc/db/postgresql/update_6x_7.sql new file mode 100644 index 000000000..08d87c575 --- /dev/null +++ b/etc/db/postgresql/update_6x_7.sql @@ -0,0 +1,18 @@ +-- Hibernate 6 defaults GenerationType.AUTO id generators to a pooled optimizer +-- with allocationSize=50, and validates that against the real sequence's +-- INCREMENT BY at boot (hibernate.id.sequence.increment_size_mismatch_strategy +-- = EXCEPTION by default). All entities share IdEntity's AUTO strategy, so +-- every per-table sequence in this schema needs to move from INCREMENT BY 1 +-- to INCREMENT BY 50 to match. +DO $$ +DECLARE + seq RECORD; +BEGIN + FOR seq IN + SELECT sequence_schema, sequence_name + FROM information_schema.sequences + WHERE sequence_schema = 'public' + LOOP + EXECUTE format('ALTER SEQUENCE %I.%I INCREMENT BY 50', seq.sequence_schema, seq.sequence_name); + END LOOP; +END $$; diff --git a/mappings/pom.xml b/mappings/pom.xml index 8d18841a8..68668974c 100644 --- a/mappings/pom.xml +++ b/mappings/pom.xml @@ -12,15 +12,6 @@ - - - org.hibernate.orm - hibernate-maven-plugin - - true - - - src/main/hbm diff --git a/mappings/src/main/resources/orm/proxy/service.orm.xml b/mappings/src/main/resources/orm/proxy/service.orm.xml new file mode 100644 index 000000000..9562c9569 --- /dev/null +++ b/mappings/src/main/resources/orm/proxy/service.orm.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index d14e4a4bb..466c60030 100644 --- a/pom.xml +++ b/pom.xml @@ -23,14 +23,6 @@ https://52north.org - - - bredel - Henning Bredel - h.bredel@52north.org - - - The Apache Software License, Version 2.0 @@ -57,7 +49,7 @@ 3.0 35.0 1.12 - 6.0.2.Final + 6.6.54.Final 3.2.0 2.0.18 3.0.0 @@ -155,6 +147,11 @@ jakarta.el-api 6.0.1 + + jakarta.activation + jakarta.activation-api + 2.1.1 + com.neovisionaries From 1764ed009d5bb138e277712dc170f5964fac2fb9 Mon Sep 17 00:00:00 2001 From: speckij Date: Thu, 20 Aug 2026 15:21:53 +0200 Subject: [PATCH 3/3] Migrate to Hibernate 6 + Spring 6 Assisted-by: claude/opus AI-Scope: draft Reviewed-by: Jan Speckamp --- .../db/beans/AbstractCodespaceEntity.java | 65 +++ .../db/beans/AbstractDatasetEntity.java | 137 ++++-- .../db/beans/AbstractFeatureEntity.java | 3 + .../n52/series/db/beans/BlobDataEntity.java | 25 +- .../series/db/beans/BooleanDataEntity.java | 14 +- .../series/db/beans/CategoryDataEntity.java | 14 +- .../n52/series/db/beans/CategoryEntity.java | 3 +- .../n52/series/db/beans/CodespaceEntity.java | 5 +- .../series/db/beans/ComplexDataEntity.java | 5 - .../series/db/beans/CompositeDataEntity.java | 17 +- .../n52/series/db/beans/CountDataEntity.java | 24 +- .../series/db/beans/DataArrayDataEntity.java | 7 - .../org/n52/series/db/beans/DataEntity.java | 150 +++--- .../n52/series/db/beans/DatasetEntity.java | 29 +- .../series/db/beans/DescribableEntity.java | 82 +--- .../n52/series/db/beans/FeatureEntity.java | 7 +- .../org/n52/series/db/beans/FormatEntity.java | 3 +- .../series/db/beans/GeometryDataEntity.java | 16 + .../n52/series/db/beans/GeometryEntity.java | 8 + .../series/db/beans/HierarchicalEntity.java | 2 +- .../series/db/beans/IdentifiableEntity.java | 84 ++++ .../n52/series/db/beans/OfferingEntity.java | 57 ++- .../n52/series/db/beans/PhenomenonEntity.java | 7 +- .../n52/series/db/beans/PlatformEntity.java | 6 +- .../n52/series/db/beans/ProcedureEntity.java | 23 +- .../series/db/beans/ProfileDataEntity.java | 5 - .../series/db/beans/QuantityDataEntity.java | 28 +- .../n52/series/db/beans/RecordDataEntity.java | 36 -- .../series/db/beans/ReferencedDataEntity.java | 15 +- .../series/db/beans/RelatedDataEntity.java | 6 +- .../series/db/beans/RelatedFeatureEntity.java | 2 +- .../series/db/beans/ResultTemplateEntity.java | 4 +- .../series/db/beans/SensorML20DataEntity.java | 12 +- .../n52/series/db/beans/ServiceEntity.java | 24 +- .../org/n52/series/db/beans/TagEntity.java | 21 +- .../n52/series/db/beans/TextDataEntity.java | 14 +- .../series/db/beans/TrajectoryDataEntity.java | 4 - .../org/n52/series/db/beans/UnitEntity.java | 11 +- .../db/beans/VerticalMetadataEntity.java | 11 +- .../db/beans/feature/SpecimenEntity.java | 13 +- .../feature/wml/MonitoringPointEntity.java | 14 +- .../series/db/beans/i18n/I18nDataEntity.java | 13 +- .../db/beans/i18n/I18nDatasetEntity.java | 3 +- .../n52/series/db/beans/i18n/I18nEntity.java | 4 +- .../series/db/beans/i18n/I18nTagEntity.java | 2 +- .../series/db/beans/i18n/I18nUnitEntity.java | 5 +- .../i18n/I18nVerticalMetadataEntity.java | 3 + .../db/beans/parameter/ParameterEntity.java | 3 +- .../dataset/DatasetParameterEntity.java | 1 - .../ObservationParameterEntity.java | 3 +- .../n52/series/db/beans/sta/GroupEntity.java | 4 +- .../beans/sta/HistoricalLocationEntity.java | 11 +- .../series/db/beans/sta/LicenseEntity.java | 4 +- .../series/db/beans/sta/LocationEntity.java | 11 +- .../n52/series/db/beans/sta/PartyEntity.java | 4 +- .../series/db/beans/sta/ProjectEntity.java | 4 +- .../Objects/AbstractFeatureEntityTest.java | 10 - .../n52/series/db/beans/DataEntityTest.java | 13 + etc/db/postgresql/update_6x_7.sql | 123 ++++- .../metadata/create_metadata_table.sql | 15 - .../metadata/insert_example_metadata.sql | 5 - .../ereporting/core/AssessmentType.hbm.xml | 18 - .../ereporting/core/CategoryResource.hbm.xml | 69 --- .../ereporting/core/CodespaceResource.hbm.xml | 22 - .../ereporting/core/EReportingQuality.hbm.xml | 32 -- .../ereporting/core/FeatureResource.hbm.xml | 162 ------- .../ereporting/core/FormatResource.hbm.xml | 22 - .../ereporting/core/LocationResource.hbm.xml | 136 ------ .../main/hbm/ereporting/core/Network.hbm.xml | 29 -- .../ereporting/core/OfferingResource.hbm.xml | 187 -------- .../core/PhenomenonResource.hbm.xml | 118 ----- .../core/ProcedureHistoryResource.hbm.xml | 42 -- .../ereporting/core/ProcedureResource.hbm.xml | 157 ------- .../core/RelatedDataResource.hbm.xml | 31 -- .../core/RelatedDatasetResource.hbm.xml | 33 -- .../core/RelatedFeatureResource.hbm.xml | 36 -- .../core/ResultTemplateResource.hbm.xml | 69 --- .../hbm/ereporting/core/TagResource.hbm.xml | 73 --- .../hbm/ereporting/core/UnitResource.hbm.xml | 64 --- .../core/VerticalMetadataResource.hbm.xml | 82 ---- .../ereporting/dataset/DataResource.hbm.xml | 408 ---------------- .../dataset/DatasetResource.hbm.xml | 306 ------------ .../dataset/PlatformResource.hbm.xml | 112 ----- .../ereporting/sampling/DataResource.hbm.xml | 416 ----------------- .../sampling/DatasetResource.hbm.xml | 339 -------------- .../sampling/MeasuringProgram.hbm.xml | 108 ----- .../sampling/PlatformResource.hbm.xml | 112 ----- .../hbm/ereporting/sampling/Sampling.hbm.xml | 164 ------- .../ereporting/staplus/DataResource.hbm.xml | 434 ------------------ .../staplus/DatasetResource.hbm.xml | 321 ------------- .../staplus/PlatformResource.hbm.xml | 117 ----- .../src/main/hbm/feature/gmd/Address.hbm.xml | 39 -- .../src/main/hbm/feature/gmd/Contact.hbm.xml | 44 -- .../src/main/hbm/feature/gmd/ExExtent.hbm.xml | 27 -- .../hbm/feature/gmd/OnlineResource.hbm.xml | 32 -- .../hbm/feature/gmd/ResponsibleParty.hbm.xml | 39 -- .../src/main/hbm/feature/gmd/Role.hbm.xml | 18 - .../main/hbm/feature/gmd/Telephone.hbm.xml | 35 -- .../hbm/feature/gmd/VerticalExExtent.hbm.xml | 37 -- .../feature/gml/CoordinateSystemAxis.hbm.xml | 61 --- .../hbm/feature/gml/DomainOfValidity.hbm.xml | 45 -- .../main/hbm/feature/gml/VerticalCRS.hbm.xml | 72 --- .../main/hbm/feature/gml/VerticalCS.hbm.xml | 52 --- .../hbm/feature/gml/VerticalDatum.hbm.xml | 71 --- .../hbm/feature/specimen/Specimen.hbm.xml | 51 -- .../hbm/feature/wml/MonitoringPoint.hbm.xml | 34 -- .../DatasetParameterResource.hbm.xml | 150 ------ .../FeatureParameterResource.hbm.xml | 149 ------ .../LocationParameterResource.hbm.xml | 153 ------ .../ObservationParameterResource.hbm.xml | 153 ------ .../PhenomenonParameterResource.hbm.xml | 159 ------- .../PlatformParameterResource.hbm.xml | 149 ------ .../ProcedureParameterResource.hbm.xml | 158 ------- .../hbm/proxy/core/CategoryResource.hbm.xml | 74 --- .../hbm/proxy/core/CodespaceResource.hbm.xml | 22 - .../hbm/proxy/core/FeatureResource.hbm.xml | 166 ------- .../hbm/proxy/core/FormatResource.hbm.xml | 22 - .../hbm/proxy/core/LocationResource.hbm.xml | 141 ------ .../hbm/proxy/core/OfferingResource.hbm.xml | 192 -------- .../hbm/proxy/core/PhenomenonResource.hbm.xml | 122 ----- .../core/ProcedureHistoryResource.hbm.xml | 42 -- .../hbm/proxy/core/ProcedureResource.hbm.xml | 162 ------- .../proxy/core/RelatedDataResource.hbm.xml | 31 -- .../proxy/core/RelatedDatasetResource.hbm.xml | 33 -- .../proxy/core/RelatedFeatureResource.hbm.xml | 41 -- .../proxy/core/ResultTemplateResource.hbm.xml | 69 --- .../hbm/proxy/core/ServiceResource.hbm.xml | 79 ---- .../main/hbm/proxy/core/TagResource.hbm.xml | 73 --- .../main/hbm/proxy/core/UnitResource.hbm.xml | 64 --- .../core/VerticalMetadataResource.hbm.xml | 82 ---- .../hbm/proxy/dataset/DataResource.hbm.xml | 377 --------------- .../hbm/proxy/dataset/DatasetResource.hbm.xml | 310 ------------- .../proxy/dataset/PlatformResource.hbm.xml | 111 ----- .../hbm/proxy/sampling/DataResource.hbm.xml | 384 ---------------- .../proxy/sampling/DatasetResource.hbm.xml | 343 -------------- .../proxy/sampling/MeasuringProgram.hbm.xml | 113 ----- .../proxy/sampling/PlatformResource.hbm.xml | 111 ----- .../main/hbm/proxy/sampling/Sampling.hbm.xml | 169 ------- .../hbm/proxy/staplus/DataResource.hbm.xml | 402 ---------------- .../hbm/proxy/staplus/DatasetResource.hbm.xml | 325 ------------- .../proxy/staplus/PlatformResource.hbm.xml | 116 ----- .../hbm/simple/core/CategoryResource.hbm.xml | 69 --- .../hbm/simple/core/FeatureResource.hbm.xml | 126 ----- .../hbm/simple/core/OfferingResource.hbm.xml | 118 ----- .../simple/core/PhenomenonResource.hbm.xml | 72 --- .../hbm/simple/core/PlatformResource.hbm.xml | 71 --- .../hbm/simple/core/ProcedureResource.hbm.xml | 84 ---- .../main/hbm/simple/core/TagResource.hbm.xml | 73 --- .../main/hbm/simple/core/UnitResource.hbm.xml | 64 --- .../core/VerticalMetadataResource.hbm.xml | 82 ---- .../hbm/simple/dataset/DataResource.hbm.xml | 276 ----------- .../simple/dataset/DatasetResource.hbm.xml | 253 ---------- .../hbm/simple/sampling/DataResource.hbm.xml | 283 ------------ .../simple/sampling/DatasetResource.hbm.xml | 286 ------------ .../simple/sampling/MeasuringProgram.hbm.xml | 108 ----- .../main/hbm/simple/sampling/Sampling.hbm.xml | 164 ------- .../staplus/GroupParameterResource.hbm.xml | 159 ------- .../main/hbm/staplus/GroupResource.hbm.xml | 145 ------ .../staplus/LicenseParameterResource.hbm.xml | 159 ------- .../main/hbm/staplus/LicenseResource.hbm.xml | 104 ----- .../main/hbm/staplus/PartyResource.hbm.xml | 115 ----- .../staplus/ProjectParameterResource.hbm.xml | 159 ------- .../main/hbm/staplus/ProjectResource.hbm.xml | 128 ------ .../staplus/RelationParameterResource.hbm.xml | 159 ------- .../main/hbm/staplus/RelationResource.hbm.xml | 64 --- .../core/CategoryResource.hbm.xml | 69 --- .../core/CodespaceResource.hbm.xml | 22 - .../core/FeatureResource.hbm.xml | 162 ------- .../transactional/core/FormatResource.hbm.xml | 22 - .../core/LocationResource.hbm.xml | 136 ------ .../core/OfferingResource.hbm.xml | 187 -------- .../core/PhenomenonResource.hbm.xml | 118 ----- .../core/ProcedureHistoryResource.hbm.xml | 42 -- .../core/ProcedureResource.hbm.xml | 157 ------- .../core/RelatedDataResource.hbm.xml | 31 -- .../core/RelatedDatasetResource.hbm.xml | 33 -- .../core/RelatedFeatureResource.hbm.xml | 36 -- .../core/ResultTemplateResource.hbm.xml | 69 --- .../transactional/core/TagResource.hbm.xml | 73 --- .../transactional/core/UnitResource.hbm.xml | 64 --- .../core/VerticalMetadataResource.hbm.xml | 82 ---- .../dataset/DataResource.hbm.xml | 378 --------------- .../dataset/DatasetResource.hbm.xml | 305 ------------ .../dataset/PlatformResource.hbm.xml | 106 ----- .../sampling/DataResource.hbm.xml | 384 ---------------- .../sampling/DatasetResource.hbm.xml | 338 -------------- .../sampling/MeasuringProgram.hbm.xml | 108 ----- .../sampling/PlatformResource.hbm.xml | 106 ----- .../transactional/sampling/Sampling.hbm.xml | 164 ------- .../staplus/DataResource.hbm.xml | 402 ---------------- .../staplus/DatasetResource.hbm.xml | 320 ------------- .../staplus/PlatformResource.hbm.xml | 111 ----- mappings/src/main/resources/hibernate.cfg.xml | 11 - .../main/resources/orm/proxy/service.orm.xml | 29 -- pom.xml | 10 - 195 files changed, 789 insertions(+), 17984 deletions(-) create mode 100644 entities/src/main/java/org/n52/series/db/beans/AbstractCodespaceEntity.java create mode 100644 entities/src/main/java/org/n52/series/db/beans/IdentifiableEntity.java delete mode 100644 entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java delete mode 100644 mappings/src/extension/metadata/create_metadata_table.sql delete mode 100644 mappings/src/extension/metadata/insert_example_metadata.sql delete mode 100644 mappings/src/main/hbm/ereporting/core/AssessmentType.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/CategoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/CodespaceResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/EReportingQuality.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/FormatResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/Network.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/PhenomenonResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/ProcedureHistoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/ProcedureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/RelatedDataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/RelatedDatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/RelatedFeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/ResultTemplateResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/TagResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/UnitResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/core/VerticalMetadataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/dataset/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/sampling/MeasuringProgram.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/sampling/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/sampling/Sampling.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/ereporting/staplus/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/Address.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/Contact.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/ExExtent.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/OnlineResource.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/ResponsibleParty.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/Role.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/Telephone.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gmd/VerticalExExtent.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gml/CoordinateSystemAxis.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gml/DomainOfValidity.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gml/VerticalCRS.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gml/VerticalCS.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/gml/VerticalDatum.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/specimen/Specimen.hbm.xml delete mode 100644 mappings/src/main/hbm/feature/wml/MonitoringPoint.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/PhenomenonParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/parameter/ProcedureParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/CategoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/CodespaceResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/FormatResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/PhenomenonResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/ProcedureHistoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/ProcedureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/RelatedDataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/RelatedDatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/RelatedFeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/ResultTemplateResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/ServiceResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/TagResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/UnitResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/core/VerticalMetadataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/dataset/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/sampling/MeasuringProgram.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/sampling/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/sampling/Sampling.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/proxy/staplus/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/CategoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/PhenomenonResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/ProcedureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/TagResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/UnitResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/core/VerticalMetadataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/dataset/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/sampling/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/sampling/MeasuringProgram.hbm.xml delete mode 100644 mappings/src/main/hbm/simple/sampling/Sampling.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/GroupParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/GroupResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/LicenseParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/LicenseResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/PartyResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/ProjectParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/ProjectResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/RelationParameterResource.hbm.xml delete mode 100644 mappings/src/main/hbm/staplus/RelationResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/CategoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/CodespaceResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/FormatResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/PhenomenonResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/ProcedureHistoryResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/ProcedureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/RelatedDataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/RelatedDatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/RelatedFeatureResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/ResultTemplateResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/TagResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/UnitResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/core/VerticalMetadataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/dataset/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/sampling/MeasuringProgram.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/sampling/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/sampling/Sampling.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml delete mode 100644 mappings/src/main/hbm/transactional/staplus/PlatformResource.hbm.xml delete mode 100644 mappings/src/main/resources/orm/proxy/service.orm.xml diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractCodespaceEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractCodespaceEntity.java new file mode 100644 index 000000000..9ef2a9c81 --- /dev/null +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractCodespaceEntity.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH + * + * 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.n52.series.db.beans; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MappedSuperclass; + +import java.io.Serial; + +/** + * Marks entities that have an identifier/name codespace in their schema, as opposed to entities extending + * {@link DescribableEntity} directly (e.g. CategoryEntity, UnitEntity, TagEntity) + */ +@SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@MappedSuperclass +public abstract class AbstractCodespaceEntity extends DescribableEntity { + + @Serial + private static final long serialVersionUID = -3196986792845310821L; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_identifier_codespace_id") + private CodespaceEntity identifierCodespace; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_name_codespace_id") + private CodespaceEntity nameCodespace; + + @Override + public CodespaceEntity getIdentifierCodespace() { + return identifierCodespace; + } + + @Override + public void setIdentifierCodespace(CodespaceEntity identifierCodespace) { + this.identifierCodespace = identifierCodespace; + } + + @Override + public CodespaceEntity getNameCodespace() { + return nameCodespace; + } + + @Override + public void setNameCodespace(CodespaceEntity nameCodespace) { + this.nameCodespace = nameCodespace; + } +} diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java index a9b7836e5..c762776ab 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractDatasetEntity.java @@ -13,23 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import java.io.Serial; -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Collections; -import java.util.Date; -import java.util.Set; -import java.util.stream.Collectors; +package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.AttributeOverride; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Embedded; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.ForeignKey; @@ -37,11 +31,18 @@ import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.SQLRestriction; import org.locationtech.jts.geom.Geometry; +import org.n52.series.db.beans.i18n.I18nDatasetEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.i18n.I18nPhenomenonEntity; import org.n52.series.db.beans.parameter.ParameterEntity; import org.n52.series.db.beans.parameter.dataset.DatasetParameterEntity; import org.n52.series.db.beans.sta.AbstractDatastreamEntity; @@ -51,7 +52,14 @@ import org.n52.series.db.beans.sta.StaRelations; import org.n52.series.db.common.Utils; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.Collections; +import java.util.Date; +import java.util.Set; +import java.util.stream.Collectors; /** * @author Jan Speckamp @@ -92,7 +100,7 @@ @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "discriminator") @AttributeOverride(name = "id", column = @Column(name = "dataset_id")) -public class AbstractDatasetEntity extends DescribableEntity +public class AbstractDatasetEntity extends AbstractCodespaceEntity implements Serializable, HibernateRelations.IsStaEntity, AbstractDatastreamEntity, StaRelations.HasLicense, StaRelations.HasParty { @@ -115,31 +123,98 @@ public class AbstractDatasetEntity extends DescribableEntity @Serial private static final long serialVersionUID = 4178505006632345142L; - private AbstractFeatureEntity feature; - private PhenomenonEntity phenomenon; + @Temporal(TemporalType.TIMESTAMP) // DELETE THIS LINE if the field is a java.time type + @Column(name = "first_time") + // @Comment("The timestamp of the temporally first observation that belongs to this dataset.") + private Date firstValueAt; + + @Temporal(TemporalType.TIMESTAMP) // DELETE THIS LINE if the field is a java.time type + @Column(name = "last_time") + // @Comment("The timestamp of the temporally last observation that belongs to this dataset.") + private Date lastValueAt; + + @Temporal(TemporalType.TIMESTAMP) // DELETE THIS LINE if the field is a java.time type + @Column(name = "result_time_start") + // @Comment("The timestamp of the earliest result time of the observations that belong to this dataset.") + private Date resultTimeStart; + + @Temporal(TemporalType.TIMESTAMP) // DELETE THIS LINE if the field is a java.time type + @Column(name = "result_time_end") + // @Comment("The timestamp of the latest result time of the observations that belong to this dataset.") + private Date resultTimeEnd; + + @Embedded + @AttributeOverride(name = "geometry", column = @Column(name = "observed_area")) + private GeometryEntity observedArea; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_procedure_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset_procedure")) private ProcedureEntity procedure; - private CategoryEntity category; - private UnitEntity unit; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_phenomenon_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset_phenomenon")) + private PhenomenonEntity phenomenon; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_offering_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset_offering")) private OfferingEntity offering; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "fk_category_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset_category")) + private CategoryEntity category; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_feature_id", foreignKey = @ForeignKey(name = "fk_dataset_feature")) + private AbstractFeatureEntity feature; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_platform_id", foreignKey = @ForeignKey(name = "fk_dataset_platform")) private PlatformEntity platform; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_unit_id", foreignKey = @ForeignKey(name = "fk_dataset_unit")) + private UnitEntity unit; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_format_id", foreignKey = @ForeignKey(name = "fk_dataset_om_obs_type")) + private FormatEntity omObservationType; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_aggregation_id", foreignKey = @ForeignKey(name = "fk_aggregation_id")) + private AbstractDatasetEntity aggregation; + + @Column(name = "first_value") + // @Comment("The value of the temporally first observation that belongs to this dataset.") + private BigDecimal firstQuantityValue; + + @Column(name = "last_value") + // @Comment("The value of the temporally last quantity observation that belongs to this dataset.") + private BigDecimal lastQuantityValue; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_first_observation_id", foreignKey = @ForeignKey(name = "fk_dataset_first_obs")) + private DataEntity firstObservation; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fk_last_observation_id", foreignKey = @ForeignKey(name = "fk_dataset_last_obs")) + private DataEntity lastObservation; + + @Transient private PartyEntity party; + + @Transient private ProjectEntity project; + + @Transient private LicenseEntity license; - private GeometryEntity observedArea; - private Set resultTimes; - private Date firstValueAt; - private Date lastValueAt; - private DataEntity firstObservation; - private DataEntity lastObservation; - private BigDecimal firstQuantityValue; - private BigDecimal lastQuantityValue; - private Date resultTimeStart; - private Date resultTimeEnd; - private FormatEntity omObservationType; + @Transient + private Set resultTimes; + @Transient private Set> observations; - private AbstractDatasetEntity aggregation; + + @Transient private boolean processed; @Override @@ -151,6 +226,14 @@ public Set> getParameters() { return super.getParameters(); } + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nDatasetEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_dataset_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset_i18n")) + public Set> getTranslations() { + return super.getTranslations(); + } + public PhenomenonEntity getPhenomenon() { return phenomenon; } diff --git a/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java index 2858f6e6b..714b1e6a3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/AbstractFeatureEntity.java @@ -34,6 +34,7 @@ import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.SQLRestriction; import org.locationtech.jts.geom.Geometry; @@ -91,12 +92,14 @@ public abstract class AbstractFeatureEntity extends HierarchicalEntity private String url; @Embedded + @AttributeOverride(name = "geometry", column = @Column(name = "geom")) private GeometryEntity geometryEntity; @OneToMany(mappedBy = DatasetEntity.PROPERTY_FEATURE, fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) private Set datasets; + @Transient private Set> observations; @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java index b72744f30..8be7fbf9d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/BlobDataEntity.java @@ -15,29 +15,46 @@ */ package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; import jakarta.persistence.ForeignKey; +import jakarta.persistence.Lob; import jakarta.persistence.PrimaryKeyJoinColumn; import jakarta.persistence.SecondaryTable; +import jakarta.persistence.Transient; import java.io.Serial; import java.util.Collection; @Entity(name = "org.n52.series.db.beans.BlobDataEntity") -@SecondaryTable(name = "value_blob", - pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_observation_id", - foreignKey = @ForeignKey(name = "fk_blob_value"))) +// @SecondaryTable(name = "value_blob", +// pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_observation_id", +// foreignKey = @ForeignKey(name = "fk_blob_value"))) @DiscriminatorValue("blob") public class BlobDataEntity extends DataEntity { @Serial private static final long serialVersionUID = 2881474333508410655L; + // @Lob + // @Column(table = "value_blob", name = "value") + // TODO: support blob values + @Transient + private byte[] value; + @Override public boolean isNoDataValue(Collection noDataValues) { return getValue() == null; } + + @Override + public Object getValue() { + return value; + } + + @Override + public void setValue(Object value) { + this.value = (byte[]) value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java index b7b5ff5cd..0930450eb 100644 --- a/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/BooleanDataEntity.java @@ -15,7 +15,6 @@ */ package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; @@ -27,6 +26,9 @@ @DiscriminatorValue("bool") public class BooleanDataEntity extends DataEntity { + @Column(name = "value_boolean") + private Boolean value; + @Serial private static final long serialVersionUID = -8729150886271878177L; @@ -34,4 +36,14 @@ public class BooleanDataEntity extends DataEntity { public boolean isNoDataValue(Collection noDataValues) { return getValue() == null ? false : noDataValues.contains(getValue().toString()); } + + @Override + public Boolean getValue() { + return value; + } + + @Override + public void setValue(Boolean value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java index a79b9776d..3240f7571 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CategoryDataEntity.java @@ -15,7 +15,6 @@ */ package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; @@ -30,6 +29,9 @@ public class CategoryDataEntity extends DataEntity { @Serial private static final long serialVersionUID = -4691677115635740162L; + @Column(name = "value_category") + private String value; + private String valueIdentifier; private String valueName; @@ -70,4 +72,14 @@ public void setValueDescription(String valueDescription) { public boolean isNoDataValue(Collection noDataValues) { return getValue() == null ? false : noDataValues.contains(getValue()); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java b/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java index f8bee1c25..fac4c5658 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CategoryEntity.java @@ -39,7 +39,8 @@ @Table(name = "category", indexes = @Index(name = "idx_category_identifier", columnList = "identifier"), uniqueConstraints = @UniqueConstraint(name = "un_category_identifier", columnNames = { "identifier" })) @AttributeOverride(name = "id", column = @Column(name = "category_id")) -@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) +@AttributeOverride(name = "staIdentifier", + column = @Column(name = "identifier", insertable = false, updatable = false)) public class CategoryEntity extends DescribableEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java b/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java index 5236b1dfb..56c2cd6f2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CodespaceEntity.java @@ -16,11 +16,9 @@ package org.n52.series.db.beans; +import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; import org.n52.series.db.beans.HibernateRelations.HasIdentifierCodespace; @@ -34,6 +32,7 @@ @Entity(name = "org.n52.series.db.beans.CodespaceEntity") @Table(name = "codespace", uniqueConstraints = @UniqueConstraint(name = "un_codespace_codespace", columnNames = { "name" })) +@AttributeOverride(name = "id", column = @Column(name = "codespace_id")) public class CodespaceEntity extends IdEntity implements Serializable { public static final String PROPERTY_CODESPACE = HasIdentifierCodespace.IDENTIFIER_CODESPACE; diff --git a/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java index 595695441..57e16662c 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ComplexDataEntity.java @@ -30,9 +30,4 @@ public class ComplexDataEntity extends CompositeDataEntity { @Serial private static final long serialVersionUID = 2206385928964743369L; - @Override - public void setValue(Set> value) { - super.setValue(value); - } - } diff --git a/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java index e16ffefdc..3db02e5dd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CompositeDataEntity.java @@ -15,7 +15,12 @@ */ package org.n52.series.db.beans; +import jakarta.persistence.CascadeType; +import jakarta.persistence.FetchType; +import jakarta.persistence.ForeignKey; +import jakarta.persistence.JoinColumn; import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.OneToMany; import java.io.Serial; import java.util.Collection; @@ -27,9 +32,19 @@ public abstract class CompositeDataEntity extends DataEntity>> @Serial private static final long serialVersionUID = -2942122854792122664L; + // the child observations reference their parent via fk_parent_observation_id, see DataEntity#parent + @OneToMany(targetEntity = DataEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) + @JoinColumn(name = "fk_parent_observation_id", foreignKey = @ForeignKey(name = "fk_parent_observation")) + private Set> value; + + @Override + public void setValue(Set> value) { + this.value = value; + } + @Override public Set> getValue() { - return super.getValue(); + return value; } @Override diff --git a/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java index d94d08471..5eda98248 100644 --- a/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/CountDataEntity.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import java.io.Serial; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.Serial; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + @Entity(name = "org.n52.series.db.beans.CountDataEntity") @DiscriminatorValue("count") public class CountDataEntity extends DataEntity implements NumericalDataEntity { @@ -36,6 +36,9 @@ public class CountDataEntity extends DataEntity implements NumericalDat @Serial private static final long serialVersionUID = -8559375927338360585L; + @Column(name = "value_count") + private Integer value; + @Override public boolean isNoDataValue(Collection noDataValues) { return getValue() == null ? false : containsValue(noDataValues, getValue()); @@ -78,4 +81,13 @@ private Collection convertToIntegers(Collection collection) { return validatedValues; } + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java index 1420e4abb..62d8fbe94 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DataArrayDataEntity.java @@ -16,10 +16,8 @@ package org.n52.series.db.beans; import java.io.Serial; -import java.util.Set; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; @@ -63,11 +61,6 @@ public boolean isSetResultTemplate() { return getResultTemplate() != null; } - @Override - public void setValue(Set> value) { - super.setValue(value); - } - /** * @return the stringValue */ diff --git a/entities/src/main/java/org/n52/series/db/beans/DataEntity.java b/entities/src/main/java/org/n52/series/db/beans/DataEntity.java index 901ed8185..31b9604d8 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DataEntity.java @@ -13,18 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import java.io.Serial; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Comparator; -import java.util.Date; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.Objects; -import java.util.Set; +package org.n52.series.db.beans; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; import jakarta.persistence.AttributeOverride; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; @@ -37,7 +31,6 @@ import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinColumn; -import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; @@ -47,12 +40,8 @@ import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.DiscriminatorOptions; -import org.hibernate.annotations.Fetch; -import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Formula; -import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.annotations.Type; -import org.hibernate.type.SqlTypes; +import org.hibernate.annotations.SQLRestriction; import org.n52.series.db.beans.HibernateRelations.HasDataset; import org.n52.series.db.beans.HibernateRelations.HasFeature; import org.n52.series.db.beans.HibernateRelations.HasParameters; @@ -63,14 +52,22 @@ import org.n52.series.db.beans.HibernateRelations.IsProcessed; import org.n52.series.db.beans.HibernateRelations.IsStaEntity; import org.n52.series.db.beans.ereporting.EReportingProfileDataEntity; +import org.n52.series.db.beans.i18n.I18nDataEntity; +import org.n52.series.db.beans.i18n.I18nEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.observation.ObservationParameterEntity; import org.n52.series.db.beans.quality.QualityEntity; import org.n52.series.db.beans.sampling.SamplingProfileDataEntity; -import org.n52.series.db.beans.sta.GroupEntity; -import org.n52.series.db.beans.sta.RelationEntity; -import org.n52.series.db.beans.sta.StaRelations; import org.n52.series.db.common.Utils; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Comparator; +import java.util.Date; +import java.util.LinkedHashSet; +import java.util.Objects; +import java.util.Set; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) @Entity(name = "org.n52.series.db.beans.DataEntity") @@ -98,7 +95,7 @@ @DiscriminatorColumn(name = "value_type") @DiscriminatorOptions(force = true) @AttributeOverride(name = "id", column = @Column(name = "observation_id")) -public abstract class DataEntity extends DescribableEntity +public abstract class DataEntity extends AbstractCodespaceEntity implements Comparable>, Serializable, HasPhenomenonTime, IsStaEntity, HasResultTime, HasValidTime, HasParameters, HasDataset, HasFeature, IsProcessed, IsNoDataValue { @@ -156,6 +153,9 @@ public abstract class DataEntity extends DescribableEntity @JoinColumn(name = "fk_dataset_id", nullable = false, foreignKey = @ForeignKey(name = "fk_dataset")) private DatasetEntity dataset; + @Column(name = "fk_dataset_id", insertable = false, updatable = false) + private Long datasetId; + @Temporal(TemporalType.TIMESTAMP) @Column(name = "sampling_time_start", nullable = false, length = 29) // @Comment("The timestamp when the observation period has started or the observation took place. In the @@ -174,9 +174,8 @@ public abstract class DataEntity extends DescribableEntity // and sampling_time_end.") private Date resultTime; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_deleted", nullable = false) - @ColumnDefault("0") + @ColumnDefault("false") // @Comment("Flag that indicates if this observation is deleted") private boolean deleted; @@ -193,9 +192,11 @@ public abstract class DataEntity extends DescribableEntity private Date validTimeEnd; @Embedded + @AttributeOverride(name = "geometry", column = @Column(name = "sampling_geometry")) private GeometryEntity geometryEntity; - @OneToMany(mappedBy = "observation", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(mappedBy = RelatedDataEntity.PROPERTY_OBSERVATION, fetch = FetchType.LAZY, cascade = CascadeType.ALL, + orphanRemoval = true) private Set relatedObservations; @Column(name = "value_identifier") @@ -210,12 +211,12 @@ public abstract class DataEntity extends DescribableEntity // @Comment("Identifier of the description. E.g. used in OGC SWE encoded values like SweText") private String valueDescription; - @Column(name = "vertical_from", nullable = false) + @Column(name = "vertical_from", nullable = false, precision = 20, scale = 10) @ColumnDefault("0") // @Comment("The start level of a vertical observation, required for profile observations") private BigDecimal verticalFrom = NOT_SET_VERTICAL; - @Column(name = "vertical_to", nullable = false) + @Column(name = "vertical_to", nullable = false, precision = 20, scale = 10) @ColumnDefault("0") // @Comment("The end level or the level of a vertical observation, required for profile observations") private BigDecimal verticalTo = NOT_SET_VERTICAL; @@ -225,27 +226,9 @@ public abstract class DataEntity extends DescribableEntity // complex or swedataarray observations.") private Long parent; - @Embedded - private EReportingProfileDataEntity ereportingProfile; - - @Column(name = "value_quantity", insertable = false, updatable = false) - private BigDecimal valueQuantity; - - @Column(name = "value_text", insertable = false, updatable = false) - private String valueText; - - @Column(name = "value_count", insertable = false, updatable = false) - private Integer valueCount; - - @Column(name = "value_category", insertable = false, updatable = false) - private String valueCategory; - - @JdbcTypeCode(SqlTypes.SMALLINT) - @Column(name = "value_boolean", insertable = false, updatable = false) - private Boolean valueBoolean; - @Transient - private T value; + // not supported yet + private EReportingProfileDataEntity ereportingProfile; @Transient private DetectionLimitEntity detectionLimit; @@ -258,8 +241,27 @@ public abstract class DataEntity extends DescribableEntity @Transient private Set> qualities = new LinkedHashSet<>(); + @Transient private boolean processed; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = ObservationParameterEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_observation_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_param_observation_id")) + @SQLRestriction("fk_parent_parameter_id is null") + public Set> getParameters() { + return super.getParameters(); + } + + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nDataEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_observation_id", nullable = false, foreignKey = @ForeignKey(name = "fk_observation")) + public Set> getTranslations() { + return super.getTranslations(); + } + /** * @return the samplingTimeStart */ @@ -298,13 +300,9 @@ public void setSamplingTimeEnd(Date samplingTimeEnd) { this.samplingTimeEnd = Utils.createUnmutableTimestamp(samplingTimeEnd); } - public T getValue() { - return value; - } + public abstract T getValue(); - public void setValue(final T value) { - this.value = value; - } + public abstract void setValue(final T value); public boolean hasValue() { return getValue() != null; @@ -517,46 +515,6 @@ public boolean hasEreportingProfile() { return getEreportingProfile() != null; } - public Boolean getValueBoolean() { - return valueBoolean; - } - - public void setValueBoolean(Boolean valueBoolean) { - this.valueBoolean = valueBoolean; - } - - public String getValueText() { - return valueText; - } - - public void setValueText(String valueText) { - this.valueText = valueText; - } - - public BigDecimal getValueQuantity() { - return valueQuantity; - } - - public void setValueQuantity(BigDecimal valueQuantity) { - this.valueQuantity = valueQuantity; - } - - public String getValueCategory() { - return valueCategory; - } - - public void setValueCategory(String valueCategory) { - this.valueCategory = valueCategory; - } - - public Integer getValueCount() { - return valueCount; - } - - public void setValueCount(Integer valueCount) { - this.valueCount = valueCount; - } - @Override public AbstractFeatureEntity getFeature() { return feature != null ? feature : getDataset().getFeature(); @@ -623,6 +581,14 @@ public void setProcessed(boolean processed) { this.processed = processed; } + public Long getDatasetId() { + return datasetId; + } + + public void setDatasetId(Long datasetId) { + this.datasetId = datasetId; + } + @Override public int compareTo(DataEntity o) { return Comparator.comparing(DataEntity::getSamplingTimeEnd) diff --git a/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java index a32166aea..3569e52c2 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DatasetEntity.java @@ -17,7 +17,6 @@ package org.n52.series.db.beans; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; @@ -78,8 +77,8 @@ public class DatasetEntity extends AbstractDatasetEntity implements HasTags { @Enumerated(EnumType.STRING) @Column(name = "dataset_type", nullable = false) @ColumnDefault("'not_initialized'") - @Check(constraints = "dataset_type in ('individualObservation', 'sampling', 'timeseries', 'profile', " - + "'trajectory', 'not_initialized')") + @Check(constraints = "dataset_type in ('individualObservation', 'timeseries', 'profile', 'trajectory', " + + "'not_initialized')") // @Comment("Indicator whether the dataset provides individualObservation (individual observations), // timeseries // (timeseries obervations) or trajectories (trajectory observations).") @@ -106,47 +105,40 @@ public class DatasetEntity extends AbstractDatasetEntity implements HasTags { // .g. link to a source, photo, video)") private ValueType valueType; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_deleted", nullable = false) - @ColumnDefault("0") + @ColumnDefault("false") // @Comment("Flag that indicates if this dataset is deleted") private boolean deleted; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_disabled", nullable = false) - @ColumnDefault("0") + @ColumnDefault("false") // @Comment("Flag that indicates if this dataset is disabled for insertion of new data") private boolean disabled; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_published", nullable = false) - @ColumnDefault("1") + @ColumnDefault("true") // @Comment("Flag that indicates if this dataset should be published") private boolean published; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_mobile", nullable = false) - @ColumnDefault("0") + @ColumnDefault("false") // @Comment("Flag that indicates if the procedure is mobile (1/true) or stationary (0/false).") private boolean mobile; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_insitu", nullable = false) - @ColumnDefault("1") + @ColumnDefault("true") // @Comment("Flag that indicates if the procedure is insitu (1/true) or remote (0/false).") private boolean insitu = true; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_hidden", nullable = false) - @ColumnDefault("0") + @ColumnDefault("false") // @Comment("Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex // datasets") private boolean hidden; @Column(name = "origin_timezone", length = 40) // @Comment("Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id - // (CET) - // or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default.") + // (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default.") private String originTimezone; @Column(name = "decimals") @@ -168,8 +160,7 @@ public class DatasetEntity extends AbstractDatasetEntity implements HasTags { @JoinColumn(name = "fk_value_profile_id", foreignKey = @ForeignKey(name = "fk_value_profile")) private VerticalMetadataEntity verticalMetadata; - @JdbcTypeCode(SqlTypes.SMALLINT) - @Formula("1") + @Formula("false") private boolean ereportingProfile; @ManyToMany(fetch = FetchType.LAZY) diff --git a/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java b/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java index b190e8438..f0b963c2b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/DescribableEntity.java @@ -18,13 +18,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import jakarta.persistence.Column; -import jakarta.persistence.FetchType; -import jakarta.persistence.ForeignKey; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Transient; -import org.n52.series.db.beans.HibernateRelations.IsStaEntity; import org.n52.series.db.beans.i18n.I18nEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -36,7 +31,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) @MappedSuperclass -public abstract class DescribableEntity extends IdEntity implements Describable, Serializable { +public abstract class DescribableEntity extends IdentifiableEntity implements Describable, Serializable { public static final String PROPERTY_IDENTIFIER = IDENTIFIER; public static final String PROPERTY_STA_IDENTIFIER = STA_IDENTIFIER; @@ -51,17 +46,6 @@ public abstract class DescribableEntity extends IdEntity implements Describable, @Serial private static final long serialVersionUID = -4448231483118864847L; - @Column(name = "identifier", nullable = false) - // @Comment("Unique identifier of the feature which is used for filtering. - // Should be a URI, UUID. E.g. http://www.example.org/123, 123-321") - private String identifier; - - @Column(name = "sta_identifier", nullable = false) - // @Comment("Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI - // (reference to a vocabulary entry), UUID. E.g. 123, 123-321") - private String staIdentifier; - - @Column(name = "name") // @Comment("The human readable name of the feature.") private String name; @@ -70,13 +54,11 @@ public abstract class DescribableEntity extends IdEntity implements Describable, // @Comment("A short description of the feature") private String description; - //@ManyToOne(fetch = FetchType.LAZY) - //@JoinColumn(name = "fk_identifier_codespace_id", foreignKey = @ForeignKey(name = "fk_feature_identifier_codesp")) - //private CodespaceEntity identifierCodespace; + @Transient + private CodespaceEntity identifierCodespace; - //@ManyToOne(fetch = FetchType.LAZY) - //@JoinColumn(name = "fk_name_codespace_id", foreignKey = @ForeignKey(name = "fk_feature_name_codespace")) - //private CodespaceEntity nameCodespace; + @Transient + private CodespaceEntity nameCodespace; @Transient // explictly mapped in subclasses @@ -93,58 +75,35 @@ public abstract class DescribableEntity extends IdEntity implements Describable, private ServiceEntity service; @Override - public String getIdentifier() { - return identifier; + public String getName() { + return name; } @Override - public void setIdentifier(String identifier, boolean staSupportsUrls) { - this.identifier = identifier; - if (!isSetStaIdentifier()) { - setStaIdentifier(staSupportsUrls ? identifier : processIdentifierForSta(identifier)); - } + public void setName(String name) { + this.name = name; } @Override - public String getStaIdentifier() { - return staIdentifier; + public CodespaceEntity getIdentifierCodespace() { + return this.identifierCodespace; } @Override - public void setStaIdentifier(String staIdentifier) { - this.staIdentifier = staIdentifier; + public void setIdentifierCodespace(CodespaceEntity identifierCodespace) { + this.identifierCodespace = identifierCodespace; } @Override - public String getName() { - return name; + public CodespaceEntity getNameCodespace() { + return nameCodespace; } @Override - public void setName(String name) { - this.name = name; + public void setNameCodespace(CodespaceEntity nameCodespace) { + this.nameCodespace = nameCodespace; } -// @Override -// public CodespaceEntity getIdentifierCodespace() { -// return this.identifierCodespace; -// } -// -// @Override -// public void setIdentifierCodespace(CodespaceEntity identifierCodespace) { -// this.identifierCodespace = identifierCodespace; -// } -// -// @Override -// public CodespaceEntity getNameCodespace() { -// return nameCodespace; -// } -// -// @Override -// public void setNameCodespace(CodespaceEntity nameCodespace) { -// this.nameCodespace = nameCodespace; -// } - @Override public String getDescription() { return description; @@ -215,8 +174,7 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(super.hashCode(), getIdentifier(), this instanceof IsStaEntity ? getStaIdentifier() : "", - getName()); + return Objects.hash(super.hashCode(), getName()); } @Override @@ -225,8 +183,6 @@ public boolean equals(Object obj) { return false; } DescribableEntity other = (DescribableEntity) obj; - return super.equals(other) && Objects.equals(getIdentifier(), other.getIdentifier()) - && (this instanceof IsStaEntity ? Objects.equals(getStaIdentifier(), other.getStaIdentifier()) : true) - && Objects.equals(getName(), other.getName()); + return super.equals(other) && Objects.equals(getName(), other.getName()); } } diff --git a/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java index 30914b33b..f0c3c5801 100644 --- a/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/FeatureEntity.java @@ -50,8 +50,13 @@ public Set getParents() { } @Override - @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @ManyToMany(fetch = FetchType.LAZY) @Access(AccessType.PROPERTY) + @JoinTable(name = "feature_hierarchy", + joinColumns = @JoinColumn(name = "fk_parent_feature_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_feature_parent")), + inverseJoinColumns = @JoinColumn(name = "fk_child_feature_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_feature_child"))) public Set getChildren() { return super.getChildren(); } diff --git a/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java b/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java index 636f7c87f..d3e2c48ee 100644 --- a/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/FormatEntity.java @@ -30,11 +30,12 @@ public class FormatEntity extends IdEntity { public static final String FORMAT = "format"; + public static final String PROPERTY_DEFINITION = "definition"; @Serial private static final long serialVersionUID = -8428858401445365107L; - @Column(name = "definition", nullable = false) + @Column(name = PROPERTY_DEFINITION, nullable = false) // @Comment("The definition of the format.") private String format; diff --git a/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java index ba50fe1c1..c8afe5588 100644 --- a/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/GeometryDataEntity.java @@ -18,6 +18,7 @@ import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Embedded; import jakarta.persistence.Entity; import java.io.Serial; @@ -30,6 +31,21 @@ public class GeometryDataEntity extends DataEntity { @Serial private static final long serialVersionUID = 3759168838980730712L; + @Embedded + @AttributeOverride(name = "geometry", column = @Column(name = "value_geometry")) + // @Comment("The geometry value of an observation (GeometryObservation)") + private GeometryEntity value; + + @Override + public void setValue(GeometryEntity value) { + this.value = value; + } + + @Override + public GeometryEntity getValue() { + return value; + } + @Override public boolean isNoDataValue(Collection noDataValues) { return false; diff --git a/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java b/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java index 0f21a81c8..22039c5a1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/GeometryEntity.java @@ -19,6 +19,8 @@ import java.io.Serializable; import java.util.StringJoiner; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Transient; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.Geometry; @@ -28,6 +30,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +@Embeddable public class GeometryEntity implements Serializable { public static final String PROPERTY_GEOMETRY = "geometry"; @@ -39,16 +42,21 @@ public class GeometryEntity implements Serializable { @Serial private static final long serialVersionUID = -1411829809704409439L; + @Transient private GeometryFactory geometryFactory = new GeometryFactory(); private Geometry geometry; + @Transient private Double lon; + @Transient private Double lat; + @Transient private Double alt; + @Transient private int srid; public boolean isSetGeometry() { diff --git a/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java b/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java index 45ed14445..6b03b60c4 100644 --- a/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/HierarchicalEntity.java @@ -23,7 +23,7 @@ import java.util.Set; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public abstract class HierarchicalEntity extends DescribableEntity { +public abstract class HierarchicalEntity extends AbstractCodespaceEntity { public static final String PROPERTY_PARENTS = "parents"; public static final String PROPERTY_CHILDREN = "children"; diff --git a/entities/src/main/java/org/n52/series/db/beans/IdentifiableEntity.java b/entities/src/main/java/org/n52/series/db/beans/IdentifiableEntity.java new file mode 100644 index 000000000..f9d8af98d --- /dev/null +++ b/entities/src/main/java/org/n52/series/db/beans/IdentifiableEntity.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH + * + * 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.n52.series.db.beans; + +import jakarta.persistence.Column; +import jakarta.persistence.MappedSuperclass; +import org.n52.series.db.beans.HibernateRelations.HasIdentifier; +import org.n52.series.db.beans.HibernateRelations.HasStaIdentifier; +import org.n52.series.db.beans.HibernateRelations.IsStaEntity; + +import java.io.Serial; +import java.util.Objects; + +/** + * Layer between {@link IdEntity} and {@link DescribableEntity} for entities that carry an + * {@code identifier}/{@code sta_identifier} but no {@code name}/{@code description} + */ +@MappedSuperclass +public abstract class IdentifiableEntity extends IdEntity implements HasIdentifier, HasStaIdentifier { + + public static final String PROPERTY_IDENTIFIER = IDENTIFIER; + public static final String PROPERTY_STA_IDENTIFIER = STA_IDENTIFIER; + + @Serial + private static final long serialVersionUID = 1394251295016960903L; + + @Column(name = "identifier") + private String identifier; + + @Column(name = "sta_identifier") + private String staIdentifier; + + @Override + public String getIdentifier() { + return identifier; + } + + @Override + public void setIdentifier(String identifier, boolean staSupportsUrls) { + this.identifier = identifier; + if (!isSetStaIdentifier()) { + setStaIdentifier(staSupportsUrls ? identifier : processIdentifierForSta(identifier)); + } + } + + @Override + public String getStaIdentifier() { + return staIdentifier; + } + + @Override + public void setStaIdentifier(String staIdentifier) { + this.staIdentifier = staIdentifier; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getIdentifier(), this instanceof IsStaEntity ? getStaIdentifier() : ""); + } + + @Override + public boolean equals(Object obj) { + if (obj == null || !(obj instanceof IdentifiableEntity)) { + return false; + } + IdentifiableEntity other = (IdentifiableEntity) obj; + return super.equals(other) && Objects.equals(getIdentifier(), other.getIdentifier()) + && (this instanceof IsStaEntity ? Objects.equals(getStaIdentifier(), other.getStaIdentifier()) : true); + } +} diff --git a/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java b/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java index b5c9211d7..580af802a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/OfferingEntity.java @@ -58,7 +58,8 @@ @Index(name = "idx_offering_name_codespace", columnList = "fk_name_codespace_id") }, uniqueConstraints = @UniqueConstraint(name = "un_offering_identifier", columnNames = { "identifier" })) @AttributeOverride(name = "id", column = @Column(name = "offering_id")) -@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) +@AttributeOverride(name = "staIdentifier", + column = @Column(name = "identifier", insertable = false, updatable = false)) public class OfferingEntity extends HierarchicalEntity implements HasObservationTypes, HasFeatureTypes, HasRelatedFeatures, HasPhenomenonTime, HasResultTimes, HasValidTime { @@ -73,84 +74,75 @@ public class OfferingEntity extends HierarchicalEntity implement @Temporal(TemporalType.TIMESTAMP) @Column(name = "sampling_time_start", length = 29) // @Comment("The minimum samplingTimeStart of all observation that belong to this offering. If the column - // is - // empty, the information is calculated during the cache update and stored locally. Used for the - // capabilities of - // the SOS.") + // is empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of the SOS.") private Date phenomenonTimeStart; @Temporal(TemporalType.TIMESTAMP) @Column(name = "sampling_time_end", length = 29) // @Comment("The maximum samplingTimeStart of all observation that belong to this offering. If the column - // is - // empty, the information is calculated during the cache update and stored locally. Used for the - // capabilities of - // the SOS.") + // is empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of the SOS.") private Date phenomenonTimeEnd; @Temporal(TemporalType.TIMESTAMP) @Column(name = "result_time_start", length = 29) // @Comment("The minimum resultTimeStart of all observation that belong to this offering. If the column is - // empty, - // the information is calculated during the cache update and stored locally. Used for the capabilities of + // empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of // the SOS.") private Date resultTimeStart; @Temporal(TemporalType.TIMESTAMP) @Column(name = "result_time_end", length = 29) // @Comment("The maximum resultTimeEnd of all observation that belong to this offering. If the column is - // empty, - // the information is calculated during the cache update and stored locally. Used for the capabilities of + // empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of // the SOS.") private Date resultTimeEnd; @Temporal(TemporalType.TIMESTAMP) @Column(name = "valid_time_start", length = 29) // @Comment("The minimum validTimeStart of all observation that belong to this offering. If the column is - // empty, - // the information is calculated during the cache update and stored locally. Used for the capabilities of + // empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of // the SOS.") private Date validTimeStart; @Temporal(TemporalType.TIMESTAMP) @Column(name = "valid_time_end", length = 29) // @Comment("The maximum validTimeEnd of all observation that belong to this offering. If the column is - // empty, the - // information is calculated during the cache update and stored locally. Used for the capabilities of the + // empty, the information is calculated during the cache update and stored locally. Used for the + // capabilities of the // SOS.") private Date validTimeEnd; @Embedded + @AttributeOverride(name = "geometry", column = @Column(name = "geom")) private GeometryEntity geometryEntity; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "offering_observation_type", joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, - foreignKey = @ForeignKey(name = "fk_offering_observation_type")), // points back at - // OfferingEntity + foreignKey = @ForeignKey(name = "fk_offering_observation_type")), inverseJoinColumns = @JoinColumn(name = "fk_format_id", nullable = false, - foreignKey = @ForeignKey(name = "fk_observation_type_offering")) // points at the target - ) + foreignKey = @ForeignKey(name = "fk_observation_type_offering"))) private Set observationTypes; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "offering_feature_type", joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, - foreignKey = @ForeignKey(name = "fk_offering_feature_type")), // points back at - // OfferingEntity + foreignKey = @ForeignKey(name = "fk_offering_feature_type")), inverseJoinColumns = @JoinColumn(name = "fk_format_id", nullable = false, - foreignKey = @ForeignKey(name = "fk_feature_type_offering")) // points at the target - ) + foreignKey = @ForeignKey(name = "fk_feature_type_offering"))) private Set featureTypes; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "offering_related_feature", joinColumns = @JoinColumn(name = "fk_offering_id", nullable = false, - foreignKey = @ForeignKey(name = "fk_offering_related_feature")), // points back at - // OfferingEntity + foreignKey = @ForeignKey(name = "fk_offering_related_feature")), inverseJoinColumns = @JoinColumn(name = "fk_related_feature_id", nullable = false, - foreignKey = @ForeignKey(name = "fk_related_feature_offering")) // points at the target - ) + foreignKey = @ForeignKey(name = "fk_related_feature_offering"))) private Set relatedFeatures; @Override @@ -174,8 +166,13 @@ public Set getParents() { } @Override - @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @ManyToMany(fetch = FetchType.LAZY) @Access(AccessType.PROPERTY) + @JoinTable(name = "offering_hierarchy", + joinColumns = @JoinColumn(name = "fk_parent_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_parent")), + inverseJoinColumns = @JoinColumn(name = "fk_child_offering_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_offering_child"))) public Set getChildren() { return super.getChildren(); } diff --git a/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java b/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java index 4289ceda8..728108ddd 100644 --- a/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/PhenomenonEntity.java @@ -94,8 +94,13 @@ public Set getParents() { } @Override - @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @ManyToMany(fetch = FetchType.LAZY) @Access(AccessType.PROPERTY) + @JoinTable(name = "composite_phenomenon", + joinColumns = @JoinColumn(name = "fk_parent_phenomenon_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_phenomenon_parent")), + inverseJoinColumns = @JoinColumn(name = "fk_child_phenomenon_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_phenomenon_child"))) public Set getChildren() { return super.getChildren(); } diff --git a/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java b/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java index e4ae0c5b1..d0d3037fc 100644 --- a/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/PlatformEntity.java @@ -55,13 +55,11 @@ indexes = { @Index(name = "idx_platform_identifier", columnList = "identifier"), @Index(name = "idx_platform_staIdentifier", columnList = "sta_identifier"), @Index(name = "idx_platform_identifier_codespace", columnList = "fk_identifier_codespace_id"), - @Index(name = "idx_platform_name_codespace", columnList = "fk_name_codespace_id"), - @Index(name = "idx_platfomr_assessment_type", columnList = "fk_assessment_type_id"), - @Index(name = "idx_platform_network", columnList = "fk_network_id") }, + @Index(name = "idx_platform_name_codespace", columnList = "fk_name_codespace_id") }, uniqueConstraints = { @UniqueConstraint(name = "un_platform_identifier", columnNames = { "identifier" }), @UniqueConstraint(name = "un_platform_staIdentifier", columnNames = { "sta_identifier" }) }) @AttributeOverride(name = "id", column = @Column(name = "platform_id")) -public class PlatformEntity extends DescribableEntity implements HasLocations, IsStaEntity, +public class PlatformEntity extends AbstractCodespaceEntity implements HasLocations, IsStaEntity, HibernateRelations.HasAbstractDatasets, HibernateRelations.IsProcessed, HibernateRelations.HasParameters, HibernateRelations.HasNetwork, HibernateRelations.HasAssessmentType, StaRelations.HasParty { diff --git a/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java index a48ad87f9..676c21aa1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProcedureEntity.java @@ -32,11 +32,10 @@ import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.ColumnDefault; -import org.hibernate.annotations.JdbcTypeCode; import org.hibernate.annotations.SQLRestriction; -import org.hibernate.type.SqlTypes; import org.locationtech.jts.geom.Geometry; import org.n52.series.db.beans.HibernateRelations.HasGeometry; import org.n52.series.db.beans.HibernateRelations.HasProcedureDescriptionFormat; @@ -75,26 +74,29 @@ public class ProcedureEntity extends HierarchicalEntity impleme @Serial private static final long serialVersionUID = 4028002933920185756L; - // Currently unmapped properties - might be required for some SOS Profiles + @Transient + // Currently unmapped properties - might be required for some SOS Profiles? private boolean deleted; + @Transient + // Currently unmapped properties - might be required for some SOS Profiles? private GeometryEntity geometryEntity; + @Transient + // Currently unmapped properties - might be required for some SOS Profiles? private boolean type; @Column(name = "description_file", columnDefinition = "text") private String descriptionFile; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_reference", nullable = false) - @ColumnDefault("0") + @ColumnDefault("false") private boolean reference; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "fk_type_of_procedure_id", foreignKey = @ForeignKey(name = "fk_type_of")) private ProcedureEntity typeOf; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_aggregation", nullable = false) - @ColumnDefault("1") + @ColumnDefault("false") private boolean aggregation; @OneToMany(mappedBy = AbstractDatasetEntity.PROPERTY_PROCEDURE, fetch = FetchType.LAZY, cascade = CascadeType.ALL, @@ -139,8 +141,13 @@ public Set getParents() { } @Override - @ManyToMany(mappedBy = "parents", fetch = FetchType.LAZY) + @ManyToMany(fetch = FetchType.LAZY) @Access(AccessType.PROPERTY) + @JoinTable(name = "procedure_hierarchy", + joinColumns = @JoinColumn(name = "fk_parent_procedure_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_procedure_parent")), + inverseJoinColumns = @JoinColumn(name = "fk_child_procedure_id", nullable = false, + foreignKey = @ForeignKey(name = "fk_procedure_child"))) public Set getChildren() { return super.getChildren(); } diff --git a/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java index 2a043bb92..76b9f09d1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ProfileDataEntity.java @@ -30,9 +30,4 @@ public class ProfileDataEntity extends CompositeDataEntity { @Serial private static final long serialVersionUID = -7431276500677067329L; - @Override - public void setValue(Set> value) { - super.setValue(value); - } - } diff --git a/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java index b6aa4f0a0..d926035d3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/QuantityDataEntity.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans; -import java.io.Serial; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.Serial; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + @Entity(name = "org.n52.series.db.beans.QuantityDataEntity") @DiscriminatorValue("quantity") public class QuantityDataEntity extends DataEntity implements NumericalDataEntity { @@ -37,6 +37,19 @@ public class QuantityDataEntity extends DataEntity implements Numeri @Serial private static final long serialVersionUID = 7619426522406105659L; + @Column(name = "value_quantity", precision = 20, scale = 10) + private BigDecimal value; + + @Override + public BigDecimal getValue() { + return value; + } + + @Override + public void setValue(BigDecimal value) { + this.value = value; + } + @Override public boolean isNoDataValue(Collection noDataValues) { return getValue() == null ? false : containsValue(noDataValues, getValue()); @@ -78,5 +91,4 @@ private Collection convertToDoubles(Collection collection) { } return validatedValues; } - } diff --git a/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java deleted file mode 100644 index 5e881fe08..000000000 --- a/entities/src/main/java/org/n52/series/db/beans/RecordDataEntity.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2015-2023 52°North Spatial Information Research GmbH - * - * 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.n52.series.db.beans; - -import java.io.Serial; -import java.util.Collection; -import java.util.Map; - -public class RecordDataEntity extends DataEntity> { - - @Serial - private static final long serialVersionUID = -7378123892897587598L; - - @Override - public boolean isNoDataValue(Collection noDataValues) { - return false; - } - - public int getDimension() { - return getValue() != null ? getValue().size() : 0; - } - -} diff --git a/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java index 996230984..60615a7f1 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ReferencedDataEntity.java @@ -15,7 +15,6 @@ */ package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; @@ -30,12 +29,26 @@ public class ReferencedDataEntity extends DataEntity { @Serial private static final long serialVersionUID = 4925354534934095827L; + @Column(name = "value_reference") + // @Comment("The reference value (URI) of an observation (ReferenceObservation)") + private String value; + private String valueIdentifier; private String valueName; private String valueDescription; + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public String getValue() { + return value; + } + @Override public String getValueIdentifier() { return valueIdentifier; diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java index f44a11961..09f8cff9b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedDataEntity.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans; import jakarta.persistence.AttributeOverride; @@ -27,8 +28,6 @@ import jakarta.persistence.MapsId; import jakarta.persistence.Table; -import java.io.Serial; - @Entity(name = "org.n52.series.db.beans.RelatedDataEntity") @Table(name = "related_observation", indexes = { @@ -39,6 +38,9 @@ @AttributeOverride(name = "id", column = @Column(name = "procedure_id")) public class RelatedDataEntity extends AbstractRelationEntity> { + public static final String PROPERTY_OBSERVATION = "observation"; + public static final String PROPERTY_RELATED_OBSERVATION = "relatedObservation"; + @EmbeddedId private RelatedDataPK id = new RelatedDataPK(); diff --git a/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java b/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java index 6ea6ef13a..f532f4fde 100644 --- a/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/RelatedFeatureEntity.java @@ -61,7 +61,7 @@ public class RelatedFeatureEntity extends IdEntity implements Serializable, HasF // @Comment("The role of the related feature.") private String role; - @ManyToMany(fetch = FetchType.LAZY) + @ManyToMany(mappedBy = OfferingEntity.RELATED_FEATURES, fetch = FetchType.LAZY) private Set offerings; public RelatedFeatureEntity() { diff --git a/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java b/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java index b4d05de60..f217e6a2d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ResultTemplateEntity.java @@ -25,9 +25,9 @@ import jakarta.persistence.ForeignKey; import jakarta.persistence.Index; import jakarta.persistence.JoinColumn; -import jakarta.persistence.Lob; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; +import jakarta.persistence.Transient; import org.n52.series.db.beans.HibernateRelations.HasResultEncoding; import org.n52.series.db.beans.HibernateRelations.HasResultStructure; @@ -47,7 +47,6 @@ @Index(name = "idx_result_template_identifier", columnList = "identifier") }) // table comment: Storage of templates for the result handling operations @AttributeOverride(name = "id", column = @Column(name = "result_template_id")) - public class ResultTemplateEntity extends IdEntity implements Serializable, HasResultStructure, HasResultEncoding { public static final String PROPERTY_OFFERING = "offering"; @@ -65,6 +64,7 @@ public class ResultTemplateEntity extends IdEntity implements Serializable, HasR @Serial private static final long serialVersionUID = -8847952458819368733L; + @Transient private String domain; @ManyToOne(fetch = FetchType.LAZY, optional = false) diff --git a/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java b/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java index eae7f6aa4..daea74c48 100644 --- a/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/SensorML20DataEntity.java @@ -15,11 +15,9 @@ */ package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; -import jakarta.persistence.Lob; import java.io.Serial; import java.util.Collection; @@ -38,6 +36,16 @@ public class SensorML20DataEntity extends DataEntity { // @Comment("The XML representation of the SensorML20 Observation (SensorML20Observation)") private String value; + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public String getValue() { + return value; + } + @Override public boolean isNoDataValue(Collection noDataValues) { return getValue() == null ? false : noDataValues.contains(getValue()); diff --git a/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java b/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java index a20575ad4..669d42392 100644 --- a/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/ServiceEntity.java @@ -27,28 +27,15 @@ import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.Embedded; -import jakarta.persistence.Entity; -import jakarta.persistence.Index; -import jakarta.persistence.Lob; -import jakarta.persistence.Table; -import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.ColumnDefault; -import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.annotations.Type; -import org.hibernate.type.SqlTypes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@Entity(name = "org.n52.series.db.beans.ServiceEntity") -@Table(name = "service", - indexes = { @Index(name = "idx_service_identifier", columnList = "identifier"), - @Index(name = "idx_service_identifier_codespace", columnList = "fk_identifier_codespace_id"), - @Index(name = "idx_service_name_codespace", columnList = "fk_name_codespace_id") }, - uniqueConstraints = @UniqueConstraint(name = "un_service_identifier", columnNames = { "identifier" })) -// table comment: Storage of the service. +// Conditional Entity based on *.orm.xml mapping. Only mapped if specific SOS Profiles are active @AttributeOverride(name = "id", column = @Column(name = "service_id")) -@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) -public class ServiceEntity extends DescribableEntity { +@AttributeOverride(name = "staIdentifier", + column = @Column(name = "identifier", insertable = false, updatable = false)) +public class ServiceEntity extends AbstractCodespaceEntity { @Serial private static final long serialVersionUID = 8926184900932191238L; @@ -71,9 +58,8 @@ public class ServiceEntity extends DescribableEntity { // @Comment("The connector of the service.") private String connector; - @JdbcTypeCode(SqlTypes.SMALLINT) @Column(name = "is_supports_first_last", nullable = false) - @ColumnDefault("1") + @ColumnDefault("true") // @Comment("Flag that indicates if this service supports first/last observation queries") private boolean supportsFirstLast; diff --git a/entities/src/main/java/org/n52/series/db/beans/TagEntity.java b/entities/src/main/java/org/n52/series/db/beans/TagEntity.java index 763db4527..7454f09c7 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TagEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TagEntity.java @@ -18,7 +18,10 @@ import java.io.Serial; import java.util.Set; +import jakarta.persistence.Access; +import jakarta.persistence.AccessType; import jakarta.persistence.AttributeOverride; +import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -28,17 +31,25 @@ import jakarta.persistence.ManyToMany; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import org.hibernate.annotations.SQLRestriction; import org.n52.series.db.beans.HibernateRelations.HasDatasets; import org.n52.series.db.beans.i18n.I18nEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import org.n52.series.db.beans.i18n.I18nLocationEntity; +import org.n52.series.db.beans.i18n.I18nProcedureEntity; +import org.n52.series.db.beans.i18n.I18nTagEntity; +import org.n52.series.db.beans.parameter.ParameterEntity; +import org.n52.series.db.beans.parameter.procedure.ProcedureParameterEntity; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) @Entity(name = "org.n52.series.db.beans.TagEntity") @Table(name = "tag") // table comment: Storage of the tags which should be used to tag the data. @AttributeOverride(name = "id", column = @Column(name = "tag_id")) -@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) +@AttributeOverride(name = "staIdentifier", + column = @Column(name = "identifier", insertable = false, updatable = false)) +@AttributeOverride(name = "name", column = @Column(name = "identifier", insertable = false, updatable = false)) public class TagEntity extends DescribableEntity implements HasDatasets { @Serial @@ -52,6 +63,14 @@ public class TagEntity extends DescribableEntity implements HasDatasets { foreignKey = @ForeignKey(name = "fk_dataset_tag"))) private Set datasets; + @Override + @Access(AccessType.PROPERTY) + @OneToMany(targetEntity = I18nTagEntity.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @JoinColumn(name = "fk_tag_id", nullable = false, foreignKey = @ForeignKey(name = "fk_tag")) + public Set> getTranslations() { + return super.getTranslations(); + } + @Override public String getName() { return getIdentifier(); diff --git a/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java index 2c2561717..3626808a3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TextDataEntity.java @@ -15,7 +15,6 @@ */ package org.n52.series.db.beans; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; @@ -31,6 +30,9 @@ public class TextDataEntity extends DataEntity { @Serial private static final long serialVersionUID = 4925354534934095827L; + @Column(name = "value_text") + private String value; + @Transient private String valueIdentifier; @@ -74,4 +76,14 @@ public void setValueDescription(String valueDescription) { public boolean isNoDataValue(Collection noDataValues) { return getValue() == null ? false : noDataValues.contains(getValue()); } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } } diff --git a/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java index f39fd4237..37c60c516 100644 --- a/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/TrajectoryDataEntity.java @@ -30,8 +30,4 @@ public class TrajectoryDataEntity extends CompositeDataEntity { @Serial private static final long serialVersionUID = 2863299911063106407L; - @Override - public void setValue(Set> value) { - super.setValue(value); - } } diff --git a/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java b/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java index 8ce39dced..ecd0195ba 100644 --- a/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/UnitEntity.java @@ -27,10 +27,11 @@ @Entity(name = "org.n52.series.db.beans.UnitEntity") @Table(name = "unit", uniqueConstraints = @UniqueConstraint(name = "un_unit_symbol", columnNames = { "symbol" })) // table comment: Storage of the units of measurement of the observation values. These may be °C or m as the -// unit for -// depth/height information. +// unit for depth/height information. @AttributeOverride(name = "id", column = @Column(name = "unit_id")) -@AttributeOverride(name = "staIdentifier", column = @Column(name = "identifier", insertable = false, updatable = false)) +@AttributeOverride(name = "identifier", column = @Column(name = "symbol")) +@AttributeOverride(name = "staIdentifier", column = @Column(name = "symbol", insertable = false, updatable = false)) +@AttributeOverride(name = "description", column = @Column(name = "symbol", insertable = false, updatable = false)) public class UnitEntity extends DescribableEntity { public static final String PROPERTY_UNIT = PROPERTY_IDENTIFIER; @@ -42,6 +43,10 @@ public class UnitEntity extends DescribableEntity { // @Comment("Link/reference to an external description of the unit, e.g. to a vocabulary..") private String link; + @Column(name = "symbol", insertable = false, updatable = false) + // @Comment("Link/reference to an external description of the unit, e.g. to a vocabulary..") + private String symbol; + /** * @return the link */ diff --git a/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java index 5b5f798aa..b11f95ab5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/VerticalMetadataEntity.java @@ -49,22 +49,21 @@ public class VerticalMetadataEntity extends IdEntity { @Serial private static final long serialVersionUID = 3156288491348980598L; - @Column(name = "orientation", nullable = false) + @Column(name = "orientation") // @Comment("The \"orientation\" of the vertical values as integer. 1 => above verticalOriginName and -1 - // => below - // verticalOriginName") // Hibernate 6.2+ + // => below verticalOriginName") private Short orientation; @Column(name = "vertical_origin_name") - // @Comment("The vertical origin name of the vertical values, e.g. water surface") // Hibernate 6.2+ + // @Comment("The vertical origin name of the vertical values, e.g. water surface") private String verticalOriginName; @Column(name = "vertical_from_name") - // @Comment("The name of the vertical from values, e.g. from or depthFrom") // Hibernate 6.2+ + // @Comment("The name of the vertical from values, e.g. from or depthFrom") private String verticalFromName; @Column(name = "vertical_to_name") - // @Comment("The name of the vertical from values, e.g. to or depthTo") // Hibernate 6.2+ + // @Comment("The name of the vertical from values, e.g. to or depthTo") private String verticalToName; @ManyToOne(fetch = FetchType.LAZY, optional = false) diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java index f91878557..d0b54d662 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/SpecimenEntity.java @@ -36,12 +36,13 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -@SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -@Entity(name = "org.n52.series.db.beans.feature.SpecimenEntity") -@SecondaryTable(name = "specimen", - pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_feature_id", - foreignKey = @ForeignKey(name = "fk_specimen_feature"))) -@DiscriminatorValue("SpecimenEntity") +//TODO: support this +//@SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) +//@Entity(name = "org.n52.series.db.beans.feature.SpecimenEntity") +//@SecondaryTable(name = "specimen", +// pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_feature_id", +// foreignKey = @ForeignKey(name = "fk_specimen_feature"))) +//@DiscriminatorValue("SpecimenEntity") public class SpecimenEntity extends FeatureEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java b/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java index 3774c19b9..b9f1e3231 100644 --- a/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/feature/wml/MonitoringPointEntity.java @@ -16,13 +16,6 @@ package org.n52.series.db.beans.feature.wml; -import jakarta.persistence.AttributeOverride; -import jakarta.persistence.Column; -import jakarta.persistence.DiscriminatorValue; -import jakarta.persistence.Entity; -import jakarta.persistence.ForeignKey; -import jakarta.persistence.PrimaryKeyJoinColumn; -import jakarta.persistence.SecondaryTable; import org.n52.series.db.beans.feature.AbstractMonitoringFeature; import java.io.Serial; @@ -33,11 +26,8 @@ * @author Carsten Hollmann * @since 1.0.0 */ -@Entity(name = "org.n52.series.db.beans.feature.wml.MonitoringPointEntity") -@SecondaryTable(name = "wml_monitoring_point", - pkJoinColumns = @PrimaryKeyJoinColumn(name = "fk_feature_id", - foreignKey = @ForeignKey(name = "fk_wml_monitoring_point"))) -@DiscriminatorValue("WmlMonitoringPointEntity") +// entity registration (name, secondary table, discriminator value) now happens +// in orm/feature/wml-monitoring-point.orm.xml public class MonitoringPointEntity extends AbstractMonitoringFeature { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java index 9e427e509..e7c24e46b 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDataEntity.java @@ -13,9 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.n52.series.db.beans.i18n; -import java.io.Serial; +package org.n52.series.db.beans.i18n; import jakarta.persistence.AssociationOverride; import jakarta.persistence.AttributeOverride; @@ -26,11 +25,15 @@ import jakarta.persistence.Table; import org.n52.series.db.beans.DataEntity; +import java.io.Serial; + @Entity(name = "org.n52.series.db.beans.i18n.I18nDataEntity") -@Table(name = "observation_i18n", - indexes = @Index(name = "idx_observation_i18n_observation", columnList = "fk_observation_id")) +@Table( + name = "observation_i18n", + indexes = @Index(name = "idx_observation_i18n_observation", columnList = "fk_observation_id")) @AttributeOverride(name = "id", column = @Column(name = "observation_i18n_id")) -@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_observation_id", nullable = false)) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_observation_id", nullable = false, + insertable = false, updatable = false)) public class I18nDataEntity extends I18nEntity> { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java index 64ce47807..31cd9c867 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nDatasetEntity.java @@ -31,7 +31,8 @@ @Entity(name = "org.n52.series.db.beans.i18n.I18nDatasetEntity") @Table(name = "dataset_i18n", indexes = @Index(name = "idx_dataset_i18n_dataset", columnList = "fk_dataset_id")) @AttributeOverride(name = "id", column = @Column(name = "dataset_i18n_id")) -@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_dataset_id", nullable = false)) +@AssociationOverride(name = "entity", + joinColumns = @JoinColumn(name = "fk_dataset_id", insertable = false, updatable = false)) public class I18nDatasetEntity extends I18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java index 59bee9cdb..0a661d62a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nEntity.java @@ -19,7 +19,6 @@ import jakarta.persistence.Column; import jakarta.persistence.FetchType; import jakarta.persistence.JoinColumn; -import jakarta.persistence.Lob; import jakarta.persistence.ManyToOne; import jakarta.persistence.MappedSuperclass; import org.n52.series.db.beans.DescribableEntity; @@ -36,8 +35,7 @@ public abstract class I18nEntity extends AbstractI1 // @Comment("Locale/language specific name of the location") private String name; - @Lob - @Column(name = "description") + @Column(name = "description", columnDefinition = "text") // @Comment("Locale/language specific description of the location") private String description; diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java index d3a4521e1..d0acfa8e3 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nTagEntity.java @@ -29,7 +29,7 @@ @Entity(name = "org.n52.series.db.beans.i18n.I18nTagEntity") @Table(name = "tag_i18n", indexes = @Index(name = "idx_tag_i18n_tag", columnList = "fk_tag_id")) @AttributeOverride(name = "id", column = @Column(name = "tag_i18n_id")) -@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_tag_id", nullable = false)) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_tag_id", nullable = false, insertable = false, updatable = false)) public class I18nTagEntity extends I18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java index 1489f4a12..ff6da2601 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nUnitEntity.java @@ -19,6 +19,7 @@ import jakarta.persistence.AssociationOverride; import jakarta.persistence.AttributeOverride; +import jakarta.persistence.AttributeOverrides; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Index; @@ -28,7 +29,9 @@ @Entity(name = "org.n52.series.db.beans.i18n.I18nUnitEntity") @Table(name = "unit_i18n", indexes = @Index(name = "idx_unit_i18n_unit", columnList = "fk_unit_id")) -@AttributeOverride(name = "id", column = @Column(name = "unit_i18n_id")) +@AttributeOverrides({ @AttributeOverride(name = "id", column = @Column(name = "unit_i18n_id")), + @AttributeOverride(name = "description", + column = @Column(name = "unit_i18n_id", insertable = false, updatable = false)) }) @AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_unit_id", nullable = false)) public class I18nUnitEntity extends I18nEntity { diff --git a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java index 40e3251fe..432c51dae 100644 --- a/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/i18n/I18nVerticalMetadataEntity.java @@ -16,6 +16,7 @@ package org.n52.series.db.beans.i18n; +import jakarta.persistence.AssociationOverride; import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -32,6 +33,8 @@ @Table(name = "value_profile_i18n", indexes = @Index(name = "idx_value_profile_i18n_value_profile", columnList = "fk_value_profile_id")) @AttributeOverride(name = "id", column = @Column(name = "value_profile_i18n_id")) +@AssociationOverride(name = "entity", joinColumns = @JoinColumn(name = "fk_value_profile_id", nullable = false, + insertable = false, updatable = false)) public class I18nVerticalMetadataEntity extends AbstractI18nEntity { @Serial diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java index b4810cd14..6a05793c5 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/ParameterEntity.java @@ -22,8 +22,8 @@ import java.util.Map; import java.util.Objects; +import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; -import jakarta.persistence.Lob; import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Temporal; import jakarta.persistence.TemporalType; @@ -35,6 +35,7 @@ @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) @MappedSuperclass +@AttributeOverride(name = "id", column = @Column(name = "parameter_id")) public abstract class ParameterEntity extends IdEntity implements ValuedParameter, Comparable> { diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java index cd8ea85d1..04e5fcd37 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/dataset/DatasetParameterEntity.java @@ -19,7 +19,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import jakarta.persistence.Access; import jakarta.persistence.AccessType; -import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; diff --git a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java index 44e2b97de..e21711c9d 100644 --- a/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/parameter/observation/ObservationParameterEntity.java @@ -17,7 +17,6 @@ import jakarta.persistence.Access; import jakarta.persistence.AccessType; -import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -58,7 +57,7 @@ public abstract class ObservationParameterEntity extends ParameterEntity { private static final long serialVersionUID = -3170715124801725482L; @ManyToOne(fetch = FetchType.LAZY, optional = false) - @JoinColumn(name = "fk_observation_id", nullable = false, + @JoinColumn(name = "fk_observation_id", nullable = false, insertable = false, updatable = false, foreignKey = @ForeignKey(name = "fk_param_observation_id")) private DataEntity observation; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java index d16cafe78..1fe083d30 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/GroupEntity.java @@ -20,8 +20,8 @@ import java.util.Date; import java.util.Set; +import org.n52.series.db.beans.AbstractCodespaceEntity; import org.n52.series.db.beans.DataEntity; -import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.sta.StaRelations.HasLicense; import org.n52.series.db.beans.sta.StaRelations.HasParty; @@ -30,7 +30,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public class GroupEntity extends DescribableEntity +public class GroupEntity extends AbstractCodespaceEntity implements Serializable, HibernateRelations.HasName, HibernateRelations.HasDescription, StaPlusTime, HasLicense, HasParty, HibernateRelations.IsProcessed { public static final String PROPERTY_RELATIONS = "relations"; diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java index fe18977c9..9e061f55e 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/HistoricalLocationEntity.java @@ -30,10 +30,11 @@ import jakarta.persistence.Table; import jakarta.persistence.Temporal; import jakarta.persistence.TemporalType; +import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; -import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.IdEntity; +import org.n52.series.db.beans.IdentifiableEntity; import org.n52.series.db.beans.PlatformEntity; import org.n52.series.db.beans.sta.StaRelations.HasLocations; import org.n52.series.db.common.Utils; @@ -58,8 +59,9 @@ @AttributeOverride(name = "id", column = @Column(name = "historical_location_id")) @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public class HistoricalLocationEntity extends DescribableEntity implements Serializable, - HasLocations, HibernateRelations.IsProcessed, HibernateRelations.HasThing { +public class HistoricalLocationEntity extends IdentifiableEntity + implements Serializable, HasLocations, HibernateRelations.IsProcessed, + HibernateRelations.HasThing, HibernateRelations.IsStaEntity { public static final String PROPERTY_IDENTIFIER = "identifier"; public static final String PROPERTY_TIME = "time"; @@ -75,13 +77,14 @@ public class HistoricalLocationEntity extends DescribableEntity implements Seria foreignKey = @ForeignKey(name = "fk_platform_historical_location")) private PlatformEntity platform; - @ManyToMany(fetch = FetchType.LAZY) + @ManyToMany(mappedBy = LocationEntity.PROPERTY_HISTORICAL_LOCATIONS, fetch = FetchType.LAZY) private Set locations; @Temporal(TemporalType.TIMESTAMP) @Column(name = "time", nullable = false, length = 29) private Date time; + @Transient private boolean processed; public Date getTime() { diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java index ed6fcf145..94fad6c2a 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/LicenseEntity.java @@ -19,14 +19,14 @@ import java.io.Serializable; import java.util.Set; +import org.n52.series.db.beans.AbstractCodespaceEntity; import org.n52.series.db.beans.AbstractDatasetEntity; -import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.HibernateRelations; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public class LicenseEntity extends DescribableEntity +public class LicenseEntity extends AbstractCodespaceEntity implements Serializable, HibernateRelations.HasName, HibernateRelations.HasDescription, HibernateRelations.HasAbstractDatasets, HibernateRelations.IsProcessed, StaRelations.HasGroups { diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java index d789a13f0..c16dd7f00 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/LocationEntity.java @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.n52.series.db.beans.sta; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.AttributeOverride; @@ -27,11 +29,11 @@ import jakarta.persistence.Index; import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinTable; -import jakarta.persistence.Lob; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.SQLRestriction; import org.locationtech.jts.geom.Geometry; @@ -42,8 +44,6 @@ import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.HibernateRelations.HasGeometry; import org.n52.series.db.beans.PlatformEntity; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.n52.series.db.beans.i18n.I18nEntity; import org.n52.series.db.beans.i18n.I18nLocationEntity; import org.n52.series.db.beans.parameter.ParameterEntity; @@ -83,14 +83,14 @@ public class LocationEntity extends DescribableEntity implements Serializable, H private String location; @Embedded + @AttributeOverride(name = "geometry", column = @Column(name = "geom")) private GeometryEntity geometryEntity; @ManyToOne(fetch = FetchType.LAZY, optional = false) @JoinColumn(name = "fk_format_id", nullable = false, foreignKey = @ForeignKey(name = "fk_location_format")) private FormatEntity locationEncoding; - @ManyToMany(fetch = FetchType.LAZY) - // TODO mappedBy = "" + @ManyToMany(mappedBy = PlatformEntity.PROPERTY_LOCATIONS, fetch = FetchType.LAZY) private Set platforms; @ManyToMany(fetch = FetchType.LAZY) @@ -118,6 +118,7 @@ public Set> getTranslations() { return super.getTranslations(); } + @Transient private boolean processed; public FormatEntity getLocationEncoding() { diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java index 1e6c3d5a4..606c8aa92 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/PartyEntity.java @@ -19,15 +19,15 @@ import java.io.Serializable; import java.util.Set; +import org.n52.series.db.beans.AbstractCodespaceEntity; import org.n52.series.db.beans.AbstractDatasetEntity; -import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.PlatformEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public class PartyEntity extends DescribableEntity implements Serializable, HibernateRelations.HasName, +public class PartyEntity extends AbstractCodespaceEntity implements Serializable, HibernateRelations.HasName, HibernateRelations.HasDescription, HibernateRelations.HasAbstractDatasets, StaRelations.HasPlatforms, StaRelations.HasGroups { diff --git a/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java b/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java index 84d45886f..237c82fba 100644 --- a/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java +++ b/entities/src/main/java/org/n52/series/db/beans/sta/ProjectEntity.java @@ -20,15 +20,15 @@ import java.util.Date; import java.util.Set; +import org.n52.series.db.beans.AbstractCodespaceEntity; import org.n52.series.db.beans.AbstractDatasetEntity; -import org.n52.series.db.beans.DescribableEntity; import org.n52.series.db.beans.HibernateRelations; import org.n52.series.db.beans.sta.StaRelations.StaPlusTime; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings({ "EI_EXPOSE_REP", "EI_EXPOSE_REP2" }) -public class ProjectEntity extends DescribableEntity implements Serializable, HibernateRelations.HasName, +public class ProjectEntity extends AbstractCodespaceEntity implements Serializable, HibernateRelations.HasName, HibernateRelations.HasDescription, StaPlusTime, HibernateRelations.HasAbstractDatasets { public static final String PROPERTY_URL = "url"; public static final String PROPERTY_CLASSIFICATION = "classification"; diff --git a/entities/src/test/java/Objects/AbstractFeatureEntityTest.java b/entities/src/test/java/Objects/AbstractFeatureEntityTest.java index 7a14c1c40..94a4dc4da 100644 --- a/entities/src/test/java/Objects/AbstractFeatureEntityTest.java +++ b/entities/src/test/java/Objects/AbstractFeatureEntityTest.java @@ -15,16 +15,6 @@ */ package Objects; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.n52.series.db.beans.FeatureEntity; - public class AbstractFeatureEntityTest { - @Test - public void test_hash() { - FeatureEntity featureEntity = new FeatureEntity(); - Assertions.assertEquals(57259294, featureEntity.hashCode()); - } - } diff --git a/entities/src/test/java/org/n52/series/db/beans/DataEntityTest.java b/entities/src/test/java/org/n52/series/db/beans/DataEntityTest.java index 1d9b376c4..7d285ead9 100644 --- a/entities/src/test/java/org/n52/series/db/beans/DataEntityTest.java +++ b/entities/src/test/java/org/n52/series/db/beans/DataEntityTest.java @@ -112,8 +112,21 @@ public void when_identifierNotNull_then_hascodeIsnotEqual() { private DataEntity createDataDummy() { DataEntity dataEntity = new DataEntity() { + + private Object value; + private static final long serialVersionUID = 410887669441410239L; + @Override + public void setValue(Object value) { + this.value = value; + } + + @Override + public Object getValue() { + return value; + } + @Override public boolean isNoDataValue(Collection noDataValues) { // TODO Auto-generated method stub diff --git a/etc/db/postgresql/update_6x_7.sql b/etc/db/postgresql/update_6x_7.sql index 08d87c575..7ef01b1cb 100644 --- a/etc/db/postgresql/update_6x_7.sql +++ b/etc/db/postgresql/update_6x_7.sql @@ -1,18 +1,105 @@ --- Hibernate 6 defaults GenerationType.AUTO id generators to a pooled optimizer --- with allocationSize=50, and validates that against the real sequence's --- INCREMENT BY at boot (hibernate.id.sequence.increment_size_mismatch_strategy --- = EXCEPTION by default). All entities share IdEntity's AUTO strategy, so --- every per-table sequence in this schema needs to move from INCREMENT BY 1 --- to INCREMENT BY 50 to match. -DO $$ -DECLARE - seq RECORD; -BEGIN - FOR seq IN - SELECT sequence_schema, sequence_name - FROM information_schema.sequences - WHERE sequence_schema = 'public' - LOOP - EXECUTE format('ALTER SEQUENCE %I.%I INCREMENT BY 50', seq.sequence_schema, seq.sequence_name); - END LOOP; -END $$; +-- Hibernate 6 uses a pooled sequence - adjust existing sequences appropriately + -- dataset_parameter + CREATE SEQUENCE IF NOT EXISTS dataset_parameter_SEQ; + SELECT setval('dataset_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM dataset_parameter), 0) + 1, false); + + -- feature_parameter + CREATE SEQUENCE IF NOT EXISTS feature_parameter_SEQ; + SELECT setval('feature_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM feature_parameter), 0) + 1, false); + + -- location_parameter + CREATE SEQUENCE IF NOT EXISTS location_parameter_SEQ; + SELECT setval('location_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM location_parameter), 0) + 1, false); + + -- observation_parameter + CREATE SEQUENCE IF NOT EXISTS observation_parameter_SEQ; + SELECT setval('observation_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM observation_parameter), 0) + 1, false); + + -- phenomenon_parameter + CREATE SEQUENCE IF NOT EXISTS phenomenon_parameter_SEQ; + SELECT setval('phenomenon_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM phenomenon_parameter), 0) + 1, false); + + -- platform_parameter + CREATE SEQUENCE IF NOT EXISTS platform_parameter_SEQ; + SELECT setval('platform_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM platform_parameter), 0) + 1, false); + + -- procedure_parameter + CREATE SEQUENCE IF NOT EXISTS procedure_parameter_SEQ; + SELECT setval('procedure_parameter_SEQ', COALESCE((SELECT MAX(parameter_id) FROM procedure_parameter), 0) + 1, false); + + DO $$ + DECLARE + seq RECORD; + BEGIN + FOR seq IN + SELECT sequence_schema, sequence_name + FROM information_schema.sequences + WHERE sequence_schema = 'public' + LOOP + EXECUTE format('ALTER SEQUENCE %I.%I INCREMENT BY 50', seq.sequence_schema, seq.sequence_name); + END LOOP; + END $$; + + +-- convert all boolean columns previously encoded as SMALLINT into real boolean columns +-- required for Hibernate6 as it emits invalid SQL otherwise + +drop index if exists idx_dataset_ts_s_cq; + +alter table dataset drop constraint if exists dataset_is_deleted_check; +alter table dataset drop constraint if exists dataset_is_disabled_check; +alter table dataset drop constraint if exists dataset_is_hidden_check; +alter table dataset drop constraint if exists dataset_is_insitu_check; +alter table dataset drop constraint if exists dataset_is_mobile_check; +alter table dataset drop constraint if exists dataset_is_published_check; +alter table observation drop constraint if exists observation_is_deleted_check; +alter table "procedure" drop constraint if exists procedure_is_aggregation_check; +alter table "procedure" drop constraint if exists procedure_is_reference_check; + +alter table dataset alter column is_deleted drop default; +alter table dataset alter column is_disabled drop default; +alter table dataset alter column is_hidden drop default; +alter table dataset alter column is_insitu drop default; +alter table dataset alter column is_mobile drop default; +alter table dataset alter column is_published drop default; +alter table observation alter column is_deleted drop default; +alter table "procedure" alter column is_aggregation drop default; +alter table "procedure" alter column is_reference drop default; + +alter table dataset alter column is_deleted type boolean using is_deleted <> 0; +alter table dataset alter column is_disabled type boolean using is_disabled <> 0; +alter table dataset alter column is_hidden type boolean using is_hidden <> 0; +alter table dataset alter column is_insitu type boolean using is_insitu <> 0; +alter table dataset alter column is_mobile type boolean using is_mobile <> 0; +alter table dataset alter column is_published type boolean using is_published <> 0; +alter table observation alter column is_deleted type boolean using is_deleted <> 0; +alter table observation alter column value_boolean type boolean using value_boolean <> 0; +alter table "procedure" alter column is_aggregation type boolean using is_aggregation <> 0; +alter table "procedure" alter column is_reference type boolean using is_reference <> 0; +alter table dataset_parameter alter column value_boolean type boolean using value_boolean <> 0; +alter table feature_parameter alter column value_boolean type boolean using value_boolean <> 0; +alter table location_parameter alter column value_boolean type boolean using value_boolean <> 0; +alter table observation_parameter alter column value_boolean type boolean using value_boolean <> 0; +alter table phenomenon_parameter alter column value_boolean type boolean using value_boolean <> 0; +alter table platform_parameter alter column value_boolean type boolean using value_boolean <> 0; +alter table procedure_parameter alter column value_boolean type boolean using value_boolean <> 0; + +alter table dataset alter column is_deleted set default false; +alter table dataset alter column is_disabled set default false; +alter table dataset alter column is_hidden set default false; +alter table dataset alter column is_insitu set default true; +alter table dataset alter column is_mobile set default false; +alter table dataset alter column is_published set default true; +alter table observation alter column is_deleted set default false; +alter table "procedure" alter column is_aggregation set default true; +alter table "procedure" alter column is_reference set default false; + +create index idx_dataset_ts_s_cq on dataset + using btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) + where (not is_deleted + and is_published + and first_time is not null + and last_time is not null + and (dataset_type)::text = 'timeseries'::text + and (observation_type)::text = 'simple'::text + and (value_type)::text = any (array[('count'::character varying)::text, ('quantity'::character varying)::text])); \ No newline at end of file diff --git a/mappings/src/extension/metadata/create_metadata_table.sql b/mappings/src/extension/metadata/create_metadata_table.sql deleted file mode 100644 index fb37933b7..000000000 --- a/mappings/src/extension/metadata/create_metadata_table.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE series_metadata -( - metadata_id bigint NOT NULL, - series_id bigint NOT NULL, - field_name character varying(255) NOT NULL, - field_type character varying(10) DEFAULT 'string', - field_value text, - last_update timestamp, - CONSTRAINT seriespk PRIMARY KEY (metadata_id), - CONSTRAINT seriesfk FOREIGN KEY (series_id) - REFERENCES series (seriesid) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT metadataidentity UNIQUE (series_id, field_name), - CONSTRAINT chk_type CHECK (field_type IN ('string','boolean','integer','double','text','json')) -) \ No newline at end of file diff --git a/mappings/src/extension/metadata/insert_example_metadata.sql b/mappings/src/extension/metadata/insert_example_metadata.sql deleted file mode 100644 index 11fb416ea..000000000 --- a/mappings/src/extension/metadata/insert_example_metadata.sql +++ /dev/null @@ -1,5 +0,0 @@ -INSERT INTO series_metadata VALUES (1, 1, 'integrationPeriod', 'string', 'PT1M') ; -INSERT INTO series_metadata VALUES (2, 1, 'booleanMetadataField', 'boolean','false'); -INSERT INTO series_metadata VALUES (3, 1, 'numericMetadataField', 'double', '42.17'); -INSERT INTO series_metadata VALUES (4, 1, 'timeseries_copyright', 'string', '(C) 2015'); -INSERT INTO series_metadata VALUES (5, 1, 'structured_metadata_example', 'json', '{"key":"value","object":{"key1":"string","key2":42}}'); \ No newline at end of file diff --git a/mappings/src/main/hbm/ereporting/core/AssessmentType.hbm.xml b/mappings/src/main/hbm/ereporting/core/AssessmentType.hbm.xml deleted file mode 100644 index 0bff39774..000000000 --- a/mappings/src/main/hbm/ereporting/core/AssessmentType.hbm.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/CategoryResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/CategoryResource.hbm.xml deleted file mode 100644 index 30569ef6d..000000000 --- a/mappings/src/main/hbm/ereporting/core/CategoryResource.hbm.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Storage of the categories which should be used to group the data (e.g. grouping of phemomenon). - - - PK column of the table - - - category_seq - - - - - Unique identifier of the category which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the category. - - - - - A short description of the category - - - - - - - - - - - Storage for internationalizations of categories. - - - PK column of the table - - - category_i18n_seq - - - - - Reference to the category table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the category - - - - - Locale/language specific description of the category - - - - diff --git a/mappings/src/main/hbm/ereporting/core/CodespaceResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/CodespaceResource.hbm.xml deleted file mode 100644 index 5fb55eabc..000000000 --- a/mappings/src/main/hbm/ereporting/core/CodespaceResource.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Storage of codespaces which can be domain specific. - - - PK column of the table - - - codespace_seq - - - - - Name/definition of the codespace, e.g. of a domain - - - - diff --git a/mappings/src/main/hbm/ereporting/core/EReportingQuality.hbm.xml b/mappings/src/main/hbm/ereporting/core/EReportingQuality.hbm.xml deleted file mode 100644 index bb012c28b..000000000 --- a/mappings/src/main/hbm/ereporting/core/EReportingQuality.hbm.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - ereporting_quality_seq - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml deleted file mode 100644 index 284886617..000000000 --- a/mappings/src/main/hbm/ereporting/core/FeatureResource.hbm.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - Storage of the features (OfInterest). A feature represents the observed location, route, or area. As examples, the location of the weather station or the water level location, a ferry (Cuxhaven-Helgoland) or a lake of interest. - - - PK column of the table - - - feature_seq - - - - - - Indicator used by Hibernate to map value specific entities (e.g. of a WaterML 2.0 MonitoringPoint) which are stored in separate tables. - - - - - - Reference to the featureType in the format table. Required by the SOS to identify the typ of the feature, e.g. http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint. - - - - - - Unique identifier of the feature which is used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the feature identifier, reference to the codespace table. - - - - - The human readable name of the feature. - - - - - The codespace of the feature name, reference to the codespace table. - - - - - A short description of the feature - - - - - - The XML encoded representation of the feature. - - - - - - Optional URL to an external resource that describes the feature, e.g. a WFS - - - - - - - - The geometry/location of feature - - - - - - Storage of hierarchies between features - - - Reference to the child feature in feature table. - - - - - Reference to the parent feature in feature table. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of features. - - - PK column of the table - - - feature_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the feature - - - - - Locale/language specific description of the feature - - - - - CREATE INDEX idx_feature_geom ON ${schema}.feature USING gist (geom) - - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/FormatResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/FormatResource.hbm.xml deleted file mode 100644 index 21d36c9d5..000000000 --- a/mappings/src/main/hbm/ereporting/core/FormatResource.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Storage of types (feature, observation) and formats (procedure)., e.g. http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement and http://www.opengis.net/sensorml/2.0 - - - PK column of the table - - - format_seq - - - - - The definition of the format. - - - - diff --git a/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml deleted file mode 100644 index 96bc10b5a..000000000 --- a/mappings/src/main/hbm/ereporting/core/LocationResource.hbm.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - location_seq - - - - - Unique identifier of the location. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - historical_location_seq - - - - - Unique identifier of the HistoricalLocation. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - location_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the location - - - - - Locale/language specific description of the location - - - - - Locale/language specific location property of the location - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/Network.hbm.xml b/mappings/src/main/hbm/ereporting/core/Network.hbm.xml deleted file mode 100644 index 36607b75d..000000000 --- a/mappings/src/main/hbm/ereporting/core/Network.hbm.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - network_seq - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml deleted file mode 100644 index f7c4c5d25..000000000 --- a/mappings/src/main/hbm/ereporting/core/OfferingResource.hbm.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - Storage of the offerings which is required by the SOS. An offering is used in SOS to group records according to specific criteria. In the INSPIRE context, an offering is an "INSPRE spatial dataset," an identifiable collection of spatial data. - - - PK column of the table - - - offering_seq - - - - - Unique identifier of the offering which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - The codespace of the offering identifier, reference to the codespace table. - - - - - The human readable name of the offering. - - - - - The codespace of the offering name, reference to the codespace table. - - - - - A short description of the offering - - - - - - The minimum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum resultTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum resultTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum validTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum validTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - Reference to the child offering in offering table. - - - - - Reference to the parent offering in offering table. - - - - - - - - - - - Relation to store the valid observationTypes for the offering - - - The related offering - - - - - The reference of the related observationType from the format table - - - - - - Relation to store the valid featureTypes for the offering - - - The related offering - - - - - The reference of the related featureType from the format table - - - - - - Storage tfor the relation between offering and relatedFeature - - - The related offering - - - - - The reference to the relatedFeature from the relatedFeature table - - - - - - - - - - - - Storage for internationalizations of offerings. - - - PK column of the table - - - offering_i18n_seq - - - - - Reference to the offering table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the offering - - - - - Locale/language specific description of the offering - - - - diff --git a/mappings/src/main/hbm/ereporting/core/PhenomenonResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/PhenomenonResource.hbm.xml deleted file mode 100644 index 9b01d22a0..000000000 --- a/mappings/src/main/hbm/ereporting/core/PhenomenonResource.hbm.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - Storage of the phenomenon/observableProperties, e.g. air temperature, water temperature, ... - - - PK column of the table - - - phenomenon_seq - - - - - - Unique identifier of the phenomenon which can be used for filtering. Should be a URI (reference to a vocabulary entry), UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the phenomenon identifier, reference to the codespace table. - - - - - The human readable name of the phenomenon. - - - - - The codespace of the phenomenon name, reference to the codespace table. - - - - - A short description of the phenomenon - - - - - - - - - - Storage of hierarchies between phenomenon, e.g. for composite phenomenon like weather with temperature, windspeed, ... - - - Reference to the child phenomenon in phenomenon table. - - - - - Reference to the parent phenomenon in phenomenon table. - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of phenomenon. - - - PK column of the table - - - phenomenon_i18n_seq - - - - - Reference to the phenomenon table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the phenomenon - - - - - Locale/language specific description of the phenomenon - - - - diff --git a/mappings/src/main/hbm/ereporting/core/ProcedureHistoryResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/ProcedureHistoryResource.hbm.xml deleted file mode 100644 index 868443db8..000000000 --- a/mappings/src/main/hbm/ereporting/core/ProcedureHistoryResource.hbm.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - Storage of historical procedure descriptions as XML encoded text with period of validity. - - - PK column of the table - - - procedure_history_seq - - - - - Reference to the procedure this entry belongs to. - - - - - Reference to the format of the procedure description, e.g. SensorML 2.0 - - - - - The timestamp from which this procedure description is valid. - - - - - The timestamp until this procedure description is valid. If null, this procedure description is currently valid - - - - - XML representation of this procedure description - - - - diff --git a/mappings/src/main/hbm/ereporting/core/ProcedureResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/ProcedureResource.hbm.xml deleted file mode 100644 index 3fe2f0297..000000000 --- a/mappings/src/main/hbm/ereporting/core/ProcedureResource.hbm.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - procedure_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - procedure_i18n_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/RelatedDataResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/RelatedDataResource.hbm.xml deleted file mode 100644 index 9491883e9..000000000 --- a/mappings/src/main/hbm/ereporting/core/RelatedDataResource.hbm.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Store the relation of two observation, e.g. one observation depends on other observations to provide context - - - - The reference to the dataset that has a related data/observation - - - - - The reference to the related data/observation - - - - - - Definition of the role of the relation - - - - - URL that point to external information - - - - diff --git a/mappings/src/main/hbm/ereporting/core/RelatedDatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/RelatedDatasetResource.hbm.xml deleted file mode 100644 index abca900ba..000000000 --- a/mappings/src/main/hbm/ereporting/core/RelatedDatasetResource.hbm.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Store the relation of two datasets, e.g. one dataset depends on other datasets to provide context - - - - The reference to the dataset that has a related dataset - - - - - The reference to the related dataset - - - - - - Definition of the role of the relation - - - - - URL that point to external information - - - - diff --git a/mappings/src/main/hbm/ereporting/core/RelatedFeatureResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/RelatedFeatureResource.hbm.xml deleted file mode 100644 index 145cb15c9..000000000 --- a/mappings/src/main/hbm/ereporting/core/RelatedFeatureResource.hbm.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - Storage of relations between offerings and features. This table is used by the SOS to fulfill the standard. - - - PK column of the table - - - related_feature_seq - - - - - Reference to the feature that is related to the offering. - - - - - The role of the related feature. - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/ereporting/core/ResultTemplateResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/ResultTemplateResource.hbm.xml deleted file mode 100644 index e81f332e1..000000000 --- a/mappings/src/main/hbm/ereporting/core/ResultTemplateResource.hbm.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Storage of templates for the result handling operations - - - PK column of the table - - - result_template_seq - - - - - The offering that is associated with the result template - - - - - The phenomenon that is associated with the result template - - - - - The procedure that is associated with the result template. Can be null if the feature is defined in the structure. - - - - - The feature that is associated with the result template. Can be null if the feature is defined in the structure. - - - - - The category that is associated with the result template - - - - - Unique identifier of the result template used for insertion operation - - - - - - The structure of the result template, should be a XML encoded swe:DataRecord - - - - - The encding of the result template, should be a XML encoded swe:TextEncoding - - - - - - The structure of the result template used for observations, should be a XML encoded swe:DataRecord - - - - - The encding of the result template used for observations, should be a XML encoded swe:TextEncoding - - - - diff --git a/mappings/src/main/hbm/ereporting/core/TagResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/TagResource.hbm.xml deleted file mode 100644 index 9dbf0ed60..000000000 --- a/mappings/src/main/hbm/ereporting/core/TagResource.hbm.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - Storage of the tags which should be used to tag the data. - - - PK column of the table - - - tag_seq - - - - - Unique identifier/name of the tag which can be used for filtering. - - - - - - A short description of the tag - - - - - - - - - - - - - - - - - - - Storage for internationalizations of tags. - - - PK column of the table - - - tag_i18n_seq - - - - - Reference to the tag table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the tag - - - - - Locale/language specific description of the tag - - - - diff --git a/mappings/src/main/hbm/ereporting/core/UnitResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/UnitResource.hbm.xml deleted file mode 100644 index f6808cc42..000000000 --- a/mappings/src/main/hbm/ereporting/core/UnitResource.hbm.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Storage of the units of measurement of the observation values. These may be °C or m as the unit for depth/height information. - - - PK column of the table - - - unit_seq - - - - - The symbol of the unit, e.g. °C or m. - - - - - Human readable name of the unit, e.g degree celsius or meter - - - - - Link/reference to an external description of the unit, e.g. to a vocabulary.. - - - - - - - - - - - Storage for internationalizations of units. - - - PK column of the table - - - unit_i18n_seq - - - - - Reference to the unit table this internationalization belongs to. - - - - - Locale/language specification for this unit. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the unit - - - - diff --git a/mappings/src/main/hbm/ereporting/core/VerticalMetadataResource.hbm.xml b/mappings/src/main/hbm/ereporting/core/VerticalMetadataResource.hbm.xml deleted file mode 100644 index 2c003ec09..000000000 --- a/mappings/src/main/hbm/ereporting/core/VerticalMetadataResource.hbm.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - Storage of meta-information about a profile measurement. These are the orientation (height/depth) and name of the depth/height value as they should be named in the output and the unit of the depth/height value. A value_profile must be defined for each dataset containing profile data. - - - PK column of the table - - - value_profile_seq - - - - - The "orientation" of the vertical values as integer. 1 => above verticalOriginName and -1 => below verticalOriginName - - - - - The vertical origin name of the vertical values, e.g. water surface - - - - - The name of the vertical from values, e.g. from or depthFrom - - - - - The name of the vertical from values, e.g. to or depthTo - - - - - The unit of the vertical value, e.g. m - - - - - - - - - - - - PK column of the table - - - value_profile_i18n_seq - - - - - Reference to the value_profile table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific vertical origin name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - diff --git a/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml deleted file mode 100644 index d2c74f5cf..000000000 --- a/mappings/src/main/hbm/ereporting/dataset/DataResource.hbm.xml +++ /dev/null @@ -1,408 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml deleted file mode 100644 index 8552fa0ec..000000000 --- a/mappings/src/main/hbm/ereporting/dataset/DatasetResource.hbm.xml +++ /dev/null @@ -1,306 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/ereporting/dataset/PlatformResource.hbm.xml b/mappings/src/main/hbm/ereporting/dataset/PlatformResource.hbm.xml deleted file mode 100644 index f59aaa686..000000000 --- a/mappings/src/main/hbm/ereporting/dataset/PlatformResource.hbm.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml deleted file mode 100644 index aa0023746..000000000 --- a/mappings/src/main/hbm/ereporting/sampling/DataResource.hbm.xml +++ /dev/null @@ -1,416 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - The id of the sampling this observation belongs to. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml deleted file mode 100644 index f892cb0cc..000000000 --- a/mappings/src/main/hbm/ereporting/sampling/DatasetResource.hbm.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - - - Flag that indicates if this dataset has samplings - - - - Storage of relations between dataset and related samplings - - - The reference to the dataset in the dataset table - - - - - The reference to the sampling in the dataset sampling - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the dataset in the dataset table - - - - - The reference to the measuring program in the dataset measuring program - - - - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/ereporting/sampling/MeasuringProgram.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/MeasuringProgram.hbm.xml deleted file mode 100644 index 018f4b258..000000000 --- a/mappings/src/main/hbm/ereporting/sampling/MeasuringProgram.hbm.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - Storage of the measuring program which describes a measurement campaign and summarizes all sampling, time series, etc. - - - PK column of the table - - - measuring_program_seq - - - - - - Unique identifier of the measuring program which would be the ORDER_ID in the output of the REST API. - - - - - - The human readable name or label of the sampling. - - - - - - A short description of the measuring program - - - - - - The producer of the measuring program, e.g. name of a person or an organization - - - - - - The timestamp when the measuring program period has started. - - - - - - The timestamp when the measuring program period has finished. - - - - - - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the measuring program. - - - - - The reference to the dataset in the dataset table - - - - - - - - - - - - - - PK column of the table - - - measuring_program_i18n_seq - - - - - Reference to the measuring program table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the measuring program entity - - - - - Locale/language specific description of the measuring program entity - - - - diff --git a/mappings/src/main/hbm/ereporting/sampling/PlatformResource.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/PlatformResource.hbm.xml deleted file mode 100644 index f59aaa686..000000000 --- a/mappings/src/main/hbm/ereporting/sampling/PlatformResource.hbm.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/ereporting/sampling/Sampling.hbm.xml b/mappings/src/main/hbm/ereporting/sampling/Sampling.hbm.xml deleted file mode 100644 index 8728dfa02..000000000 --- a/mappings/src/main/hbm/ereporting/sampling/Sampling.hbm.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - Storage of the Description of a sampling that was performed in a measuring program. - - - PK column of the table - - - sampling_seq - - - - - - Reference to the measuring program to which this sampling belongs. - - - - - - The identifier of the sampling. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - - The human readable name or the label of the sampling. - - - - - - A short description or the COMMENT of the sampling - - - - - - The sampler (e.g. name of a person or an organization) who take the sample. - - - - - - The sampling method used to take the sample - - - - - - The environmental conditions when the sample was made, e.g. sunny, dry, hot - - - - - - The timestamp when the sampling period has started. - - - - - - The timestamp when the sampling period has finished. - - - - - Storage of relations between datasets and related samplings - - - The reference to the sampling in the sampling table. - - - - - The reference to the dataset in the dataset table that provides observations related to the sampling. - - - - - - - - - - - - - - - - - - - PK column of the table - - - sampling_i18n_seq - - - - - Reference to the sampling table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the sampling entity - - - - - Locale/language specific description of the sampling entity - - - - - Locale/language specific sampling method of the sampling entity - - - - - Locale/language specific environmental conditions of the sampling entity - - - - - CREATE or REPLACE FUNCTION insert_dataset_sampling_flag() RETURNS TRIGGER AS $$ BEGIN UPDATE ${schema}.dataset SET is_samplings = 1 WHERE dataset_id = NEW.fk_dataset_id; RETURN NEW; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS insert_dataset_sampling_flag() - - - - - - CREATE or REPLACE FUNCTION delete_dataset_sampling_flag() RETURNS TRIGGER AS $$ DECLARE dataset_count SMALLINT; BEGIN SELECT count(fk_dataset_id) INTO dataset_count FROM ${schema}.sampling_dataset WHERE fk_dataset_id = OLD.fk_dataset_id; IF dataset_count = 0 THEN UPDATE ${schema}.dataset SET is_samplings = 0 WHERE dataset_id = OLD.fk_dataset_id; END IF; RETURN OLD; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS delete_dataset_sampling_flag() - - - - - - CREATE TRIGGER insert_dataset_sampling_flag AFTER INSERT ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE insert_dataset_sampling_flag() - DROP TRIGGER IF EXISTS insert_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - - CREATE TRIGGER delete_dataset_sampling_flag AFTER DELETE ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE delete_dataset_sampling_flag() - DROP TRIGGER IF EXISTS delete_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - diff --git a/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml b/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml deleted file mode 100644 index 935876941..000000000 --- a/mappings/src/main/hbm/ereporting/staplus/DataResource.hbm.xml +++ /dev/null @@ -1,434 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Relation to store the groups for observatios - - - The related observations - - - - - The reference of the related groups from the group table - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml b/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml deleted file mode 100644 index 742dda968..000000000 --- a/mappings/src/main/hbm/ereporting/staplus/DatasetResource.hbm.xml +++ /dev/null @@ -1,321 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the party of the observations that belongs to this dataset. - - - - - Reference to the project of the observations that belongs to this dataset. - - - - - Reference to the license of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/ereporting/staplus/PlatformResource.hbm.xml b/mappings/src/main/hbm/ereporting/staplus/PlatformResource.hbm.xml deleted file mode 100644 index 2e4079aae..000000000 --- a/mappings/src/main/hbm/ereporting/staplus/PlatformResource.hbm.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - Reference to the party of the platform. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/feature/gmd/Address.hbm.xml b/mappings/src/main/hbm/feature/gmd/Address.hbm.xml deleted file mode 100644 index dcfb6d720..000000000 --- a/mappings/src/main/hbm/feature/gmd/Address.hbm.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - address_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/Contact.hbm.xml b/mappings/src/main/hbm/feature/gmd/Contact.hbm.xml deleted file mode 100644 index 46031f0b2..000000000 --- a/mappings/src/main/hbm/feature/gmd/Contact.hbm.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - contact_seq - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/ExExtent.hbm.xml b/mappings/src/main/hbm/feature/gmd/ExExtent.hbm.xml deleted file mode 100644 index 0f1dc6c12..000000000 --- a/mappings/src/main/hbm/feature/gmd/ExExtent.hbm.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - ex_extent_seq - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/OnlineResource.hbm.xml b/mappings/src/main/hbm/feature/gmd/OnlineResource.hbm.xml deleted file mode 100644 index fd3bf3c6d..000000000 --- a/mappings/src/main/hbm/feature/gmd/OnlineResource.hbm.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - online_resource_seq - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/ResponsibleParty.hbm.xml b/mappings/src/main/hbm/feature/gmd/ResponsibleParty.hbm.xml deleted file mode 100644 index 1cabbada3..000000000 --- a/mappings/src/main/hbm/feature/gmd/ResponsibleParty.hbm.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - responsible_party_seq - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/Role.hbm.xml b/mappings/src/main/hbm/feature/gmd/Role.hbm.xml deleted file mode 100644 index 3c5da0a02..000000000 --- a/mappings/src/main/hbm/feature/gmd/Role.hbm.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - role_seq - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/Telephone.hbm.xml b/mappings/src/main/hbm/feature/gmd/Telephone.hbm.xml deleted file mode 100644 index ad89acf37..000000000 --- a/mappings/src/main/hbm/feature/gmd/Telephone.hbm.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - telephone_seq - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gmd/VerticalExExtent.hbm.xml b/mappings/src/main/hbm/feature/gmd/VerticalExExtent.hbm.xml deleted file mode 100644 index de4db2d78..000000000 --- a/mappings/src/main/hbm/feature/gmd/VerticalExExtent.hbm.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - vertical_exextent_seq - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gml/CoordinateSystemAxis.hbm.xml b/mappings/src/main/hbm/feature/gml/CoordinateSystemAxis.hbm.xml deleted file mode 100644 index 086a6d501..000000000 --- a/mappings/src/main/hbm/feature/gml/CoordinateSystemAxis.hbm.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - coordinate_system_axis_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gml/DomainOfValidity.hbm.xml b/mappings/src/main/hbm/feature/gml/DomainOfValidity.hbm.xml deleted file mode 100644 index bc81bf667..000000000 --- a/mappings/src/main/hbm/feature/gml/DomainOfValidity.hbm.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - domain_of_validity_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gml/VerticalCRS.hbm.xml b/mappings/src/main/hbm/feature/gml/VerticalCRS.hbm.xml deleted file mode 100644 index 9b64e5a87..000000000 --- a/mappings/src/main/hbm/feature/gml/VerticalCRS.hbm.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - vertical_crs_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gml/VerticalCS.hbm.xml b/mappings/src/main/hbm/feature/gml/VerticalCS.hbm.xml deleted file mode 100644 index 78f0cc21f..000000000 --- a/mappings/src/main/hbm/feature/gml/VerticalCS.hbm.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - vertical_cs_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/gml/VerticalDatum.hbm.xml b/mappings/src/main/hbm/feature/gml/VerticalDatum.hbm.xml deleted file mode 100644 index a0e374ed0..000000000 --- a/mappings/src/main/hbm/feature/gml/VerticalDatum.hbm.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - vertical_datum_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/specimen/Specimen.hbm.xml b/mappings/src/main/hbm/feature/specimen/Specimen.hbm.xml deleted file mode 100644 index 0574d0e23..000000000 --- a/mappings/src/main/hbm/feature/specimen/Specimen.hbm.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/feature/wml/MonitoringPoint.hbm.xml b/mappings/src/main/hbm/feature/wml/MonitoringPoint.hbm.xml deleted file mode 100644 index 47806e9a8..000000000 --- a/mappings/src/main/hbm/feature/wml/MonitoringPoint.hbm.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml deleted file mode 100644 index 774bfca5a..000000000 --- a/mappings/src/main/hbm/parameter/DatasetParameterResource.hbm.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Dataset this Parameter describes. - - - - - - Reference to the Dataset this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml deleted file mode 100644 index 196660eac..000000000 --- a/mappings/src/main/hbm/parameter/FeatureParameterResource.hbm.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Feature this Parameter describes. - - - - - - Reference to the Feature this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml deleted file mode 100644 index 6137e83b6..000000000 --- a/mappings/src/main/hbm/parameter/LocationParameterResource.hbm.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Location this Parameter describes. - - - - - - - - - Reference to the Location this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml deleted file mode 100644 index fd8b14c64..000000000 --- a/mappings/src/main/hbm/parameter/ObservationParameterResource.hbm.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - Storage for additional information for observations - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Observation this Parameter describes. - - - - - - - - - Reference to the Observation this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/parameter/PhenomenonParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/PhenomenonParameterResource.hbm.xml deleted file mode 100644 index 8bc2b3274..000000000 --- a/mappings/src/main/hbm/parameter/PhenomenonParameterResource.hbm.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Phenomenon this Parameter describes. - - - - - - - - - Reference to the Phenomenon this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the Phenomenon this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml deleted file mode 100644 index bbd621015..000000000 --- a/mappings/src/main/hbm/parameter/PlatformParameterResource.hbm.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Platform this Parameter describes. - - - - - - Reference to the Platform this Parameter describes. - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the Platform this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/parameter/ProcedureParameterResource.hbm.xml b/mappings/src/main/hbm/parameter/ProcedureParameterResource.hbm.xml deleted file mode 100644 index de1205561..000000000 --- a/mappings/src/main/hbm/parameter/ProcedureParameterResource.hbm.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - Storage for additional information for procedures - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Procedure this Parameter describes. - - - - - - - - - Reference to the Procedure this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the Procedure this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/proxy/core/CategoryResource.hbm.xml b/mappings/src/main/hbm/proxy/core/CategoryResource.hbm.xml deleted file mode 100644 index 7acfb5941..000000000 --- a/mappings/src/main/hbm/proxy/core/CategoryResource.hbm.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - Storage of the categories which should be used to group the data (e.g. grouping of phemomenon). - - - PK column of the table - - - category_seq - - - - - Reference to the service this category belongs to. - - - - - Unique identifier of the category which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the category. - - - - - A short description of the category - - - - - - - - - - - Storage for internationalizations of categories. - - - PK column of the table - - - category_i18n_seq - - - - - Reference to the category table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the category - - - - - Locale/language specific description of the category - - - - diff --git a/mappings/src/main/hbm/proxy/core/CodespaceResource.hbm.xml b/mappings/src/main/hbm/proxy/core/CodespaceResource.hbm.xml deleted file mode 100644 index 5fb55eabc..000000000 --- a/mappings/src/main/hbm/proxy/core/CodespaceResource.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Storage of codespaces which can be domain specific. - - - PK column of the table - - - codespace_seq - - - - - Name/definition of the codespace, e.g. of a domain - - - - diff --git a/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml deleted file mode 100644 index dab2700ca..000000000 --- a/mappings/src/main/hbm/proxy/core/FeatureResource.hbm.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - Storage of the features (OfInterest). A feature represents the observed location, route, or area. As examples, the location of the weather station or the water level location, a ferry (Cuxhaven-Helgoland) or a lake of interest. - - - PK column of the table - - - feature_seq - - - - - - Indicator used by Hibernate to map value specific entities (e.g. of a WaterML 2.0 MonitoringPoint) which are stored in separate tables. - - - - - - Reference to the featureType in the format table. Required by the SOS to identify the typ of the feature, e.g. http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint. - - - - - Reference to the service this feature belongs to. - - - - - Unique identifier of the feature which is used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the feature identifier, reference to the codespace table. - - - - - The human readable name of the feature. - - - - - The codespace of the feature name, reference to the codespace table. - - - - - A short description of the feature - - - - - - The XML encoded representation of the feature. - - - - - - Optional URL to an external resource that describes the feature, e.g. a WFS - - - - - - - - The geometry/location of feature - - - - - - Storage of hierarchies between features - - - Reference to the child feature in feature table. - - - - - Reference to the parent feature in feature table. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of features. - - - PK column of the table - - - feature_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the feature - - - - - Locale/language specific description of the feature - - - - - CREATE INDEX idx_feature_geom ON ${schema}.feature USING gist (geom) - - - - - - diff --git a/mappings/src/main/hbm/proxy/core/FormatResource.hbm.xml b/mappings/src/main/hbm/proxy/core/FormatResource.hbm.xml deleted file mode 100644 index 21d36c9d5..000000000 --- a/mappings/src/main/hbm/proxy/core/FormatResource.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Storage of types (feature, observation) and formats (procedure)., e.g. http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement and http://www.opengis.net/sensorml/2.0 - - - PK column of the table - - - format_seq - - - - - The definition of the format. - - - - diff --git a/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml b/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml deleted file mode 100644 index f2493379c..000000000 --- a/mappings/src/main/hbm/proxy/core/LocationResource.hbm.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - location_seq - - - - - Reference to the service this category belongs to. - - - - - Unique identifier of the location. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - historical_location_seq - - - - - Unique identifier of the HistoricalLocation. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - location_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the location - - - - - Locale/language specific description of the location - - - - - Locale/language specific location property of the location - - - - - diff --git a/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml deleted file mode 100644 index 1ee09abac..000000000 --- a/mappings/src/main/hbm/proxy/core/OfferingResource.hbm.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - Storage of the offerings which is required by the SOS. An offering is used in SOS to group records according to specific criteria. In the INSPIRE context, an offering is an "INSPRE spatial dataset," an identifiable collection of spatial data. - - - PK column of the table - - - offering_seq - - - - - Reference to the service this offering belongs to. - - - - - Unique identifier of the offering which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - The codespace of the offering identifier, reference to the codespace table. - - - - - The human readable name of the offering. - - - - - The codespace of the offering name, reference to the codespace table. - - - - - A short description of the offering - - - - - - The minimum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum resultTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum resultTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum validTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum validTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - Reference to the child offering in offering table. - - - - - Reference to the parent offering in offering table. - - - - - - - - - - - Relation to store the valid observationTypes for the offering - - - The related offering - - - - - The reference of the related observationType from the format table - - - - - - Relation to store the valid featureTypes for the offering - - - The related offering - - - - - The reference of the related featureType from the format table - - - - - - Storage tfor the relation between offering and relatedFeature - - - The related offering - - - - - The reference to the relatedFeature from the relatedFeature table - - - - - - - - - - - - Storage for internationalizations of offerings. - - - PK column of the table - - - offering_i18n_seq - - - - - Reference to the offering table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the offering - - - - - Locale/language specific description of the offering - - - - diff --git a/mappings/src/main/hbm/proxy/core/PhenomenonResource.hbm.xml b/mappings/src/main/hbm/proxy/core/PhenomenonResource.hbm.xml deleted file mode 100644 index 8b96f8081..000000000 --- a/mappings/src/main/hbm/proxy/core/PhenomenonResource.hbm.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - Storage of the phenomenon/observableProperties, e.g. air temperature, water temperature, ... - - - PK column of the table - - - phenomenon_seq - - - - - Reference to the service this phenomenon belongs to. - - - - - Unique identifier of the phenomenon which can be used for filtering. Should be a URI (reference to a vocabulary entry), UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the phenomenon identifier, reference to the codespace table. - - - - - The human readable name of the phenomenon. - - - - - The codespace of the phenomenon name, reference to the codespace table. - - - - - A short description of the phenomenon - - - - - - - - - - Storage of hierarchies between phenomenon, e.g. for composite phenomenon like weather with temperature, windspeed, ... - - - Reference to the child phenomenon in phenomenon table. - - - - - Reference to the parent phenomenon in phenomenon table. - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of phenomenon. - - - PK column of the table - - - phenomenon_i18n_seq - - - - - Reference to the phenomenon table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the phenomenon - - - - - Locale/language specific description of the phenomenon - - - - diff --git a/mappings/src/main/hbm/proxy/core/ProcedureHistoryResource.hbm.xml b/mappings/src/main/hbm/proxy/core/ProcedureHistoryResource.hbm.xml deleted file mode 100644 index 868443db8..000000000 --- a/mappings/src/main/hbm/proxy/core/ProcedureHistoryResource.hbm.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - Storage of historical procedure descriptions as XML encoded text with period of validity. - - - PK column of the table - - - procedure_history_seq - - - - - Reference to the procedure this entry belongs to. - - - - - Reference to the format of the procedure description, e.g. SensorML 2.0 - - - - - The timestamp from which this procedure description is valid. - - - - - The timestamp until this procedure description is valid. If null, this procedure description is currently valid - - - - - XML representation of this procedure description - - - - diff --git a/mappings/src/main/hbm/proxy/core/ProcedureResource.hbm.xml b/mappings/src/main/hbm/proxy/core/ProcedureResource.hbm.xml deleted file mode 100644 index 33af08b5b..000000000 --- a/mappings/src/main/hbm/proxy/core/ProcedureResource.hbm.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - procedure_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - procedure_i18n_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/proxy/core/RelatedDataResource.hbm.xml b/mappings/src/main/hbm/proxy/core/RelatedDataResource.hbm.xml deleted file mode 100644 index 9491883e9..000000000 --- a/mappings/src/main/hbm/proxy/core/RelatedDataResource.hbm.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Store the relation of two observation, e.g. one observation depends on other observations to provide context - - - - The reference to the dataset that has a related data/observation - - - - - The reference to the related data/observation - - - - - - Definition of the role of the relation - - - - - URL that point to external information - - - - diff --git a/mappings/src/main/hbm/proxy/core/RelatedDatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/core/RelatedDatasetResource.hbm.xml deleted file mode 100644 index abca900ba..000000000 --- a/mappings/src/main/hbm/proxy/core/RelatedDatasetResource.hbm.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Store the relation of two datasets, e.g. one dataset depends on other datasets to provide context - - - - The reference to the dataset that has a related dataset - - - - - The reference to the related dataset - - - - - - Definition of the role of the relation - - - - - URL that point to external information - - - - diff --git a/mappings/src/main/hbm/proxy/core/RelatedFeatureResource.hbm.xml b/mappings/src/main/hbm/proxy/core/RelatedFeatureResource.hbm.xml deleted file mode 100644 index d0f0100c1..000000000 --- a/mappings/src/main/hbm/proxy/core/RelatedFeatureResource.hbm.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - Storage of relations between offerings and features. This table is used by the SOS to fulfill the standard. - - - PK column of the table - - - related_feature_seq - - - - - Reference to the service this platform belongs to. - - - - - Reference to the feature that is related to the offering. - - - - - The role of the related feature. - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/proxy/core/ResultTemplateResource.hbm.xml b/mappings/src/main/hbm/proxy/core/ResultTemplateResource.hbm.xml deleted file mode 100644 index e81f332e1..000000000 --- a/mappings/src/main/hbm/proxy/core/ResultTemplateResource.hbm.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Storage of templates for the result handling operations - - - PK column of the table - - - result_template_seq - - - - - The offering that is associated with the result template - - - - - The phenomenon that is associated with the result template - - - - - The procedure that is associated with the result template. Can be null if the feature is defined in the structure. - - - - - The feature that is associated with the result template. Can be null if the feature is defined in the structure. - - - - - The category that is associated with the result template - - - - - Unique identifier of the result template used for insertion operation - - - - - - The structure of the result template, should be a XML encoded swe:DataRecord - - - - - The encding of the result template, should be a XML encoded swe:TextEncoding - - - - - - The structure of the result template used for observations, should be a XML encoded swe:DataRecord - - - - - The encding of the result template used for observations, should be a XML encoded swe:TextEncoding - - - - diff --git a/mappings/src/main/hbm/proxy/core/ServiceResource.hbm.xml b/mappings/src/main/hbm/proxy/core/ServiceResource.hbm.xml deleted file mode 100644 index 93259a1b8..000000000 --- a/mappings/src/main/hbm/proxy/core/ServiceResource.hbm.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - Storage of the service. - - - PK column of the table - - - service_seq - - - - - Unique identifier of the service. - - - - - The codespace of the service identifier, reference to the codespace table. Can be null. - - - - - The human readable name of the service. - - - - - The codespace of the service name, reference to the codespace table. Can be null. - - - - - A short description of the service - - - - - The url of the service - - - - - The type of the service - - - - - The version of the service - - - - - The connector of the service. - - - - - Flag that indicates if this service supports first/last observation queries - - - - - - The metadata of the service - - - - - The format of the service, e.g. application/json, application/xml - - - - - diff --git a/mappings/src/main/hbm/proxy/core/TagResource.hbm.xml b/mappings/src/main/hbm/proxy/core/TagResource.hbm.xml deleted file mode 100644 index 9dbf0ed60..000000000 --- a/mappings/src/main/hbm/proxy/core/TagResource.hbm.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - Storage of the tags which should be used to tag the data. - - - PK column of the table - - - tag_seq - - - - - Unique identifier/name of the tag which can be used for filtering. - - - - - - A short description of the tag - - - - - - - - - - - - - - - - - - - Storage for internationalizations of tags. - - - PK column of the table - - - tag_i18n_seq - - - - - Reference to the tag table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the tag - - - - - Locale/language specific description of the tag - - - - diff --git a/mappings/src/main/hbm/proxy/core/UnitResource.hbm.xml b/mappings/src/main/hbm/proxy/core/UnitResource.hbm.xml deleted file mode 100644 index f6808cc42..000000000 --- a/mappings/src/main/hbm/proxy/core/UnitResource.hbm.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Storage of the units of measurement of the observation values. These may be °C or m as the unit for depth/height information. - - - PK column of the table - - - unit_seq - - - - - The symbol of the unit, e.g. °C or m. - - - - - Human readable name of the unit, e.g degree celsius or meter - - - - - Link/reference to an external description of the unit, e.g. to a vocabulary.. - - - - - - - - - - - Storage for internationalizations of units. - - - PK column of the table - - - unit_i18n_seq - - - - - Reference to the unit table this internationalization belongs to. - - - - - Locale/language specification for this unit. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the unit - - - - diff --git a/mappings/src/main/hbm/proxy/core/VerticalMetadataResource.hbm.xml b/mappings/src/main/hbm/proxy/core/VerticalMetadataResource.hbm.xml deleted file mode 100644 index 2c003ec09..000000000 --- a/mappings/src/main/hbm/proxy/core/VerticalMetadataResource.hbm.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - Storage of meta-information about a profile measurement. These are the orientation (height/depth) and name of the depth/height value as they should be named in the output and the unit of the depth/height value. A value_profile must be defined for each dataset containing profile data. - - - PK column of the table - - - value_profile_seq - - - - - The "orientation" of the vertical values as integer. 1 => above verticalOriginName and -1 => below verticalOriginName - - - - - The vertical origin name of the vertical values, e.g. water surface - - - - - The name of the vertical from values, e.g. from or depthFrom - - - - - The name of the vertical from values, e.g. to or depthTo - - - - - The unit of the vertical value, e.g. m - - - - - - - - - - - - PK column of the table - - - value_profile_i18n_seq - - - - - Reference to the value_profile table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific vertical origin name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - diff --git a/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml deleted file mode 100644 index 15dd8f64e..000000000 --- a/mappings/src/main/hbm/proxy/dataset/DataResource.hbm.xml +++ /dev/null @@ -1,377 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml deleted file mode 100644 index f0cb30bc5..000000000 --- a/mappings/src/main/hbm/proxy/dataset/DatasetResource.hbm.xml +++ /dev/null @@ -1,310 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the service this dataset belongs to. - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/proxy/dataset/PlatformResource.hbm.xml b/mappings/src/main/hbm/proxy/dataset/PlatformResource.hbm.xml deleted file mode 100644 index 599f54e7a..000000000 --- a/mappings/src/main/hbm/proxy/dataset/PlatformResource.hbm.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Reference to the service this platform belongs to. - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml deleted file mode 100644 index 80ed49739..000000000 --- a/mappings/src/main/hbm/proxy/sampling/DataResource.hbm.xml +++ /dev/null @@ -1,384 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - The id of the sampling this observation belongs to. - - - - - - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml deleted file mode 100644 index 4906829d7..000000000 --- a/mappings/src/main/hbm/proxy/sampling/DatasetResource.hbm.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the service this dataset belongs to. - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - - - Flag that indicates if this dataset has samplings - - - - Storage of relations between dataset and related samplings - - - The reference to the dataset in the dataset table - - - - - The reference to the sampling in the dataset sampling - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the dataset in the dataset table - - - - - The reference to the measuring program in the dataset measuring program - - - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/proxy/sampling/MeasuringProgram.hbm.xml b/mappings/src/main/hbm/proxy/sampling/MeasuringProgram.hbm.xml deleted file mode 100644 index 64c4d805b..000000000 --- a/mappings/src/main/hbm/proxy/sampling/MeasuringProgram.hbm.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - Storage of the measuring program which describes a measurement campaign and summarizes all sampling, time series, etc. - - - PK column of the table - - - measuring_program_seq - - - - - - Reference to the service this measuring program belongs to. - - - - - Unique identifier of the measuring program which would be the ORDER_ID in the output of the REST API. - - - - - - The human readable name or label of the sampling. - - - - - - A short description of the measuring program - - - - - - The producer of the measuring program, e.g. name of a person or an organization - - - - - - The timestamp when the measuring program period has started. - - - - - - The timestamp when the measuring program period has finished. - - - - - - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the measuring program. - - - - - The reference to the dataset in the dataset table - - - - - - - - - - - - - - PK column of the table - - - measuring_program_i18n_seq - - - - - Reference to the measuring program table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the measuring program entity - - - - - Locale/language specific description of the measuring program entity - - - - diff --git a/mappings/src/main/hbm/proxy/sampling/PlatformResource.hbm.xml b/mappings/src/main/hbm/proxy/sampling/PlatformResource.hbm.xml deleted file mode 100644 index 599f54e7a..000000000 --- a/mappings/src/main/hbm/proxy/sampling/PlatformResource.hbm.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Reference to the service this platform belongs to. - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/proxy/sampling/Sampling.hbm.xml b/mappings/src/main/hbm/proxy/sampling/Sampling.hbm.xml deleted file mode 100644 index 14d957f23..000000000 --- a/mappings/src/main/hbm/proxy/sampling/Sampling.hbm.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - Storage of the Description of a sampling that was performed in a measuring program. - - - PK column of the table - - - sampling_seq - - - - - - Reference to the measuring program to which this sampling belongs. - - - - - - Reference to the service this sampling belongs to. - - - - - The identifier of the sampling. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - - The human readable name or the label of the sampling. - - - - - - A short description or the COMMENT of the sampling - - - - - - The sampler (e.g. name of a person or an organization) who take the sample. - - - - - - The sampling method used to take the sample - - - - - - The environmental conditions when the sample was made, e.g. sunny, dry, hot - - - - - - The timestamp when the sampling period has started. - - - - - - The timestamp when the sampling period has finished. - - - - - Storage of relations between datasets and related samplings - - - The reference to the sampling in the sampling table. - - - - - The reference to the dataset in the dataset table that provides observations related to the sampling. - - - - - - - - - - - - - - - - - - - PK column of the table - - - sampling_i18n_seq - - - - - Reference to the sampling table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the sampling entity - - - - - Locale/language specific description of the sampling entity - - - - - Locale/language specific sampling method of the sampling entity - - - - - Locale/language specific environmental conditions of the sampling entity - - - - - CREATE or REPLACE FUNCTION insert_dataset_sampling_flag() RETURNS TRIGGER AS $$ BEGIN UPDATE ${schema}.dataset SET is_samplings = 1 WHERE dataset_id = NEW.fk_dataset_id; RETURN NEW; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS insert_dataset_sampling_flag() - - - - - - CREATE or REPLACE FUNCTION delete_dataset_sampling_flag() RETURNS TRIGGER AS $$ DECLARE dataset_count SMALLINT; BEGIN SELECT count(fk_dataset_id) INTO dataset_count FROM ${schema}.sampling_dataset WHERE fk_dataset_id = OLD.fk_dataset_id; IF dataset_count = 0 THEN UPDATE ${schema}.dataset SET is_samplings = 0 WHERE dataset_id = OLD.fk_dataset_id; END IF; RETURN OLD; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS delete_dataset_sampling_flag() - - - - - - CREATE TRIGGER insert_dataset_sampling_flag AFTER INSERT ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE insert_dataset_sampling_flag() - DROP TRIGGER IF EXISTS insert_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - - CREATE TRIGGER delete_dataset_sampling_flag AFTER DELETE ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE delete_dataset_sampling_flag() - DROP TRIGGER IF EXISTS delete_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - diff --git a/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml b/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml deleted file mode 100644 index d1040bcee..000000000 --- a/mappings/src/main/hbm/proxy/staplus/DataResource.hbm.xml +++ /dev/null @@ -1,402 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - - - - - - - - - - - - - - - - Relation to store the groups for observatios - - - The related observations - - - - - The reference of the related groups from the group table - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml b/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml deleted file mode 100644 index 9f753b462..000000000 --- a/mappings/src/main/hbm/proxy/staplus/DatasetResource.hbm.xml +++ /dev/null @@ -1,325 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the service this dataset belongs to. - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the party of the observations that belongs to this dataset. - - - - - Reference to the project of the observations that belongs to this dataset. - - - - - Reference to the license of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/proxy/staplus/PlatformResource.hbm.xml b/mappings/src/main/hbm/proxy/staplus/PlatformResource.hbm.xml deleted file mode 100644 index cffa6eaf0..000000000 --- a/mappings/src/main/hbm/proxy/staplus/PlatformResource.hbm.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Reference to the service this platform belongs to. - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - Reference to the party of the platform. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/simple/core/CategoryResource.hbm.xml b/mappings/src/main/hbm/simple/core/CategoryResource.hbm.xml deleted file mode 100644 index 30569ef6d..000000000 --- a/mappings/src/main/hbm/simple/core/CategoryResource.hbm.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Storage of the categories which should be used to group the data (e.g. grouping of phemomenon). - - - PK column of the table - - - category_seq - - - - - Unique identifier of the category which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the category. - - - - - A short description of the category - - - - - - - - - - - Storage for internationalizations of categories. - - - PK column of the table - - - category_i18n_seq - - - - - Reference to the category table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the category - - - - - Locale/language specific description of the category - - - - diff --git a/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml deleted file mode 100644 index 7dbfce14a..000000000 --- a/mappings/src/main/hbm/simple/core/FeatureResource.hbm.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - Storage of the features (OfInterest). A feature represents the observed location, route, or area. As examples, the location of the weather station or the water level location, a ferry (Cuxhaven-Helgoland) or a lake of interest. - - - PK column of the table - - - feature_seq - - - - - - Indicator used by Hibernate to map value specific entities (e.g. of a WaterML 2.0 MonitoringPoint) which are stored in separate tables. - - - - - - Unique identifier of the feature which is used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the feature. - - - - - A short description of the feature - - - - - - - - The geometry/location of feature - - - - - - Storage of hierarchies between features - - - Reference to the child feature in feature table. - - - - - Reference to the parent feature in feature table. - - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of features. - - - PK column of the table - - - feature_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the feature - - - - - Locale/language specific description of the feature - - - - - CREATE INDEX idx_feature_geom ON ${schema}.feature USING gist (geom) - - - - - - diff --git a/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml deleted file mode 100644 index 252bcc924..000000000 --- a/mappings/src/main/hbm/simple/core/OfferingResource.hbm.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - Storage of the offerings which is required by the SOS. An offering is used in SOS to group records according to specific criteria. In the INSPIRE context, an offering is an "INSPRE spatial dataset," an identifiable collection of spatial data. - - - PK column of the table - - - offering_seq - - - - - Unique identifier of the offering which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - The human readable name of the offering. - - - - - A short description of the offering - - - - - - The minimum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum resultTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum resultTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum validTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum validTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - - - - - - Storage for internationalizations of offerings. - - - PK column of the table - - - offering_i18n_seq - - - - - Reference to the offering table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the offering - - - - - Locale/language specific description of the offering - - - - diff --git a/mappings/src/main/hbm/simple/core/PhenomenonResource.hbm.xml b/mappings/src/main/hbm/simple/core/PhenomenonResource.hbm.xml deleted file mode 100644 index 699f51e45..000000000 --- a/mappings/src/main/hbm/simple/core/PhenomenonResource.hbm.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - Storage of the phenomenon/observableProperties, e.g. air temperature, water temperature, ... - - - PK column of the table - - - phenomenon_seq - - - - - - Unique identifier of the phenomenon which can be used for filtering. Should be a URI (reference to a vocabulary entry), UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the phenomenon. - - - - - A short description of the phenomenon - - - - - - - - - - - - - Storage for internationalizations of phenomenon. - - - PK column of the table - - - phenomenon_i18n_seq - - - - - Reference to the phenomenon table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the phenomenon - - - - - Locale/language specific description of the phenomenon - - - - diff --git a/mappings/src/main/hbm/simple/core/PlatformResource.hbm.xml b/mappings/src/main/hbm/simple/core/PlatformResource.hbm.xml deleted file mode 100644 index 2a9394848..000000000 --- a/mappings/src/main/hbm/simple/core/PlatformResource.hbm.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the feature or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the platform. - - - - - A short description of the platform - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/simple/core/ProcedureResource.hbm.xml b/mappings/src/main/hbm/simple/core/ProcedureResource.hbm.xml deleted file mode 100644 index d1044af52..000000000 --- a/mappings/src/main/hbm/simple/core/ProcedureResource.hbm.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - procedure_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - procedure_i18n_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/simple/core/TagResource.hbm.xml b/mappings/src/main/hbm/simple/core/TagResource.hbm.xml deleted file mode 100644 index 9dbf0ed60..000000000 --- a/mappings/src/main/hbm/simple/core/TagResource.hbm.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - Storage of the tags which should be used to tag the data. - - - PK column of the table - - - tag_seq - - - - - Unique identifier/name of the tag which can be used for filtering. - - - - - - A short description of the tag - - - - - - - - - - - - - - - - - - - Storage for internationalizations of tags. - - - PK column of the table - - - tag_i18n_seq - - - - - Reference to the tag table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the tag - - - - - Locale/language specific description of the tag - - - - diff --git a/mappings/src/main/hbm/simple/core/UnitResource.hbm.xml b/mappings/src/main/hbm/simple/core/UnitResource.hbm.xml deleted file mode 100644 index f6808cc42..000000000 --- a/mappings/src/main/hbm/simple/core/UnitResource.hbm.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Storage of the units of measurement of the observation values. These may be °C or m as the unit for depth/height information. - - - PK column of the table - - - unit_seq - - - - - The symbol of the unit, e.g. °C or m. - - - - - Human readable name of the unit, e.g degree celsius or meter - - - - - Link/reference to an external description of the unit, e.g. to a vocabulary.. - - - - - - - - - - - Storage for internationalizations of units. - - - PK column of the table - - - unit_i18n_seq - - - - - Reference to the unit table this internationalization belongs to. - - - - - Locale/language specification for this unit. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the unit - - - - diff --git a/mappings/src/main/hbm/simple/core/VerticalMetadataResource.hbm.xml b/mappings/src/main/hbm/simple/core/VerticalMetadataResource.hbm.xml deleted file mode 100644 index 2c003ec09..000000000 --- a/mappings/src/main/hbm/simple/core/VerticalMetadataResource.hbm.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - Storage of meta-information about a profile measurement. These are the orientation (height/depth) and name of the depth/height value as they should be named in the output and the unit of the depth/height value. A value_profile must be defined for each dataset containing profile data. - - - PK column of the table - - - value_profile_seq - - - - - The "orientation" of the vertical values as integer. 1 => above verticalOriginName and -1 => below verticalOriginName - - - - - The vertical origin name of the vertical values, e.g. water surface - - - - - The name of the vertical from values, e.g. from or depthFrom - - - - - The name of the vertical from values, e.g. to or depthTo - - - - - The unit of the vertical value, e.g. m - - - - - - - - - - - - PK column of the table - - - value_profile_i18n_seq - - - - - Reference to the value_profile table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific vertical origin name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - diff --git a/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml deleted file mode 100644 index 0484e1b34..000000000 --- a/mappings/src/main/hbm/simple/dataset/DataResource.hbm.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - - The human readable name of the observation. - - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/simple/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/simple/dataset/DatasetResource.hbm.xml deleted file mode 100644 index 309e3f04a..000000000 --- a/mappings/src/main/hbm/simple/dataset/DatasetResource.hbm.xml +++ /dev/null @@ -1,253 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml deleted file mode 100644 index fe4ce8b62..000000000 --- a/mappings/src/main/hbm/simple/sampling/DataResource.hbm.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - - The human readable name of the observation. - - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - The id of the sampling this observation belongs to. - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/simple/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/simple/sampling/DatasetResource.hbm.xml deleted file mode 100644 index e54030487..000000000 --- a/mappings/src/main/hbm/simple/sampling/DatasetResource.hbm.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - - - Flag that indicates if this dataset has samplings - - - - Storage of relations between dataset and related samplings - - - The reference to the dataset in the dataset table - - - - - The reference to the sampling in the dataset sampling - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the dataset in the dataset table - - - - - The reference to the measuring program in the dataset measuring program - - - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/simple/sampling/MeasuringProgram.hbm.xml b/mappings/src/main/hbm/simple/sampling/MeasuringProgram.hbm.xml deleted file mode 100644 index 018f4b258..000000000 --- a/mappings/src/main/hbm/simple/sampling/MeasuringProgram.hbm.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - Storage of the measuring program which describes a measurement campaign and summarizes all sampling, time series, etc. - - - PK column of the table - - - measuring_program_seq - - - - - - Unique identifier of the measuring program which would be the ORDER_ID in the output of the REST API. - - - - - - The human readable name or label of the sampling. - - - - - - A short description of the measuring program - - - - - - The producer of the measuring program, e.g. name of a person or an organization - - - - - - The timestamp when the measuring program period has started. - - - - - - The timestamp when the measuring program period has finished. - - - - - - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the measuring program. - - - - - The reference to the dataset in the dataset table - - - - - - - - - - - - - - PK column of the table - - - measuring_program_i18n_seq - - - - - Reference to the measuring program table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the measuring program entity - - - - - Locale/language specific description of the measuring program entity - - - - diff --git a/mappings/src/main/hbm/simple/sampling/Sampling.hbm.xml b/mappings/src/main/hbm/simple/sampling/Sampling.hbm.xml deleted file mode 100644 index 8728dfa02..000000000 --- a/mappings/src/main/hbm/simple/sampling/Sampling.hbm.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - Storage of the Description of a sampling that was performed in a measuring program. - - - PK column of the table - - - sampling_seq - - - - - - Reference to the measuring program to which this sampling belongs. - - - - - - The identifier of the sampling. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - - The human readable name or the label of the sampling. - - - - - - A short description or the COMMENT of the sampling - - - - - - The sampler (e.g. name of a person or an organization) who take the sample. - - - - - - The sampling method used to take the sample - - - - - - The environmental conditions when the sample was made, e.g. sunny, dry, hot - - - - - - The timestamp when the sampling period has started. - - - - - - The timestamp when the sampling period has finished. - - - - - Storage of relations between datasets and related samplings - - - The reference to the sampling in the sampling table. - - - - - The reference to the dataset in the dataset table that provides observations related to the sampling. - - - - - - - - - - - - - - - - - - - PK column of the table - - - sampling_i18n_seq - - - - - Reference to the sampling table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the sampling entity - - - - - Locale/language specific description of the sampling entity - - - - - Locale/language specific sampling method of the sampling entity - - - - - Locale/language specific environmental conditions of the sampling entity - - - - - CREATE or REPLACE FUNCTION insert_dataset_sampling_flag() RETURNS TRIGGER AS $$ BEGIN UPDATE ${schema}.dataset SET is_samplings = 1 WHERE dataset_id = NEW.fk_dataset_id; RETURN NEW; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS insert_dataset_sampling_flag() - - - - - - CREATE or REPLACE FUNCTION delete_dataset_sampling_flag() RETURNS TRIGGER AS $$ DECLARE dataset_count SMALLINT; BEGIN SELECT count(fk_dataset_id) INTO dataset_count FROM ${schema}.sampling_dataset WHERE fk_dataset_id = OLD.fk_dataset_id; IF dataset_count = 0 THEN UPDATE ${schema}.dataset SET is_samplings = 0 WHERE dataset_id = OLD.fk_dataset_id; END IF; RETURN OLD; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS delete_dataset_sampling_flag() - - - - - - CREATE TRIGGER insert_dataset_sampling_flag AFTER INSERT ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE insert_dataset_sampling_flag() - DROP TRIGGER IF EXISTS insert_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - - CREATE TRIGGER delete_dataset_sampling_flag AFTER DELETE ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE delete_dataset_sampling_flag() - DROP TRIGGER IF EXISTS delete_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - diff --git a/mappings/src/main/hbm/staplus/GroupParameterResource.hbm.xml b/mappings/src/main/hbm/staplus/GroupParameterResource.hbm.xml deleted file mode 100644 index b917eff32..000000000 --- a/mappings/src/main/hbm/staplus/GroupParameterResource.hbm.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Group this Parameter describes. - - - - - - - - - Reference to the Group this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the Group this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/staplus/GroupResource.hbm.xml b/mappings/src/main/hbm/staplus/GroupResource.hbm.xml deleted file mode 100644 index b0d90c793..000000000 --- a/mappings/src/main/hbm/staplus/GroupResource.hbm.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - Storage of the parties. - - - PK column of the table - - - group_seq - - - - - Unique identifier of the group which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the group identifier, reference to the codespace table. - - - - - The human readable name of the group. - - - - - The codespace of the group name, reference to the codespace table. - - - - - A short description of the group - - - - - The purpose of the group - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, run_time_start and run_time_end are equal. - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, run_time_start and run_time_end are equal. - - - - - The timestamp when the groupt was created. - - - - - Reference to the license of the group. - - - - - Reference to the party of the group. - - - - - - - - - - - - - - Relation to store the relations for groups - - - The related groups - - - - - The reference of the related relations from the relation table - - - - - - Relation to store the groups for observatios - - - The related groups - - - - - The reference of the related observations from the observation table - - - - - - - Storage for internationalizations of groups. - - - PK column of the table - - - group_i18n_seq - - - - - Reference to the group table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the group - - - - - Locale/language specific description of the group - - - - diff --git a/mappings/src/main/hbm/staplus/LicenseParameterResource.hbm.xml b/mappings/src/main/hbm/staplus/LicenseParameterResource.hbm.xml deleted file mode 100644 index d4c92ce88..000000000 --- a/mappings/src/main/hbm/staplus/LicenseParameterResource.hbm.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the License this Parameter describes. - - - - - - - - - Reference to the License this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the License this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/staplus/LicenseResource.hbm.xml b/mappings/src/main/hbm/staplus/LicenseResource.hbm.xml deleted file mode 100644 index 34a6d96ee..000000000 --- a/mappings/src/main/hbm/staplus/LicenseResource.hbm.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - Storage of the parties. - - - PK column of the table - - - license_seq - - - - - Unique identifier/definition of the license which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the license identifier, reference to the codespace table. - - - - - The human readable name of the license. - - - - - The codespace of the license name, reference to the codespace table. - - - - - A short description of the license - - - - - A logo of the license - - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of licenses. - - - PK column of the table - - - license_i18n_seq - - - - - Reference to the license table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the license - - - - - Locale/language specific description of the license - - - - diff --git a/mappings/src/main/hbm/staplus/PartyResource.hbm.xml b/mappings/src/main/hbm/staplus/PartyResource.hbm.xml deleted file mode 100644 index 193b7d1ef..000000000 --- a/mappings/src/main/hbm/staplus/PartyResource.hbm.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - Storage of the parties. - - - PK column of the table - - - party_seq - - - - - Unique identifier/autid of the party which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the party identifier, reference to the codespace table. - - - - - The human readable name of the party. - - - - - The codespace of the party name, reference to the codespace table. - - - - - A short description of the party - - - - - Indicator whether the party tole is individual or institutional. - - - org.n52.series.db.beans.sta.RolePartyCode - true - - - - - A short description of the party - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of parties. - - - PK column of the table - - - party_i18n_seq - - - - - Reference to the party table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the party - - - - - Locale/language specific description of the party - - - - diff --git a/mappings/src/main/hbm/staplus/ProjectParameterResource.hbm.xml b/mappings/src/main/hbm/staplus/ProjectParameterResource.hbm.xml deleted file mode 100644 index 27d0b3eb7..000000000 --- a/mappings/src/main/hbm/staplus/ProjectParameterResource.hbm.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Project this Parameter describes. - - - - - - - - - Reference to the Project this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the Project this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/staplus/ProjectResource.hbm.xml b/mappings/src/main/hbm/staplus/ProjectResource.hbm.xml deleted file mode 100644 index 4eb4bc1e8..000000000 --- a/mappings/src/main/hbm/staplus/ProjectResource.hbm.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - Storage of the projects. - - - PK column of the table - - - project_seq - - - - - Unique identifier of the project which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the project identifier, reference to the codespace table. - - - - - The human readable name of the project. - - - - - The codespace of the project name, reference to the codespace table. - - - - - A short description of the project - - - - - A classification of the projectr - - - - - A termsOfUse of the projectr - - - - - A privacyPolicy of the projectr - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, run_time_start and run_time_end are equal. - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, run_time_start and run_time_end are equal. - - - - - The timestamp when the groupt was created. - - - - - A url of the projectr - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of projects. - - - PK column of the table - - - project_i18n_seq - - - - - Reference to the project table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the project - - - - - Locale/language specific description of the project - - - - diff --git a/mappings/src/main/hbm/staplus/RelationParameterResource.hbm.xml b/mappings/src/main/hbm/staplus/RelationParameterResource.hbm.xml deleted file mode 100644 index 242746454..000000000 --- a/mappings/src/main/hbm/staplus/RelationParameterResource.hbm.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - Storage for additional information for platforms - - - PK column of the table - - - parameter_seq - - - - - Indicator used by Hibernate to map value specific entities. - - - - - The name of the parameter - - - - - A short description of the parameter - - - - - Timestamp that provides the time of the last modification of this entry - - - - - The domain this parameter belongs to. - - - - - - Reference to the Relation this Parameter describes. - - - - - - - - - Reference to the Relation this Parameter describes. - - - - - - - Storage of a boolean parameter value. - - - - - - - - Storage of a categorical parameter value. - - - - - Reference to the unit of this value in the unit table - - - - - - - - Storage of a count parameter value. - - - - - - - - Storage of a quantity parameter value. - - - - - - - - - - - - Storage of a textual parameter value. - - - - - - - Storage of a XML encoded parameter value. - - - - - - - Storage of a JSON encoded parameter value. - - - - - - - Reference to the Relation this Parameter describes. - - - - - - - - - - - - Storage of a temporal from parameter value. - - - - - Storage of a temporal to parameter value. - - - - - - diff --git a/mappings/src/main/hbm/staplus/RelationResource.hbm.xml b/mappings/src/main/hbm/staplus/RelationResource.hbm.xml deleted file mode 100644 index 0c450155f..000000000 --- a/mappings/src/main/hbm/staplus/RelationResource.hbm.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Store the relation of two observation or an external observation - - - PK column of the table - - - relation_seq - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - Reference to the subject of the group. - - - - - Reference to the object of the group. - - - - - The role of the relation - - - - - Description of the relation - - - - - URL that point to external object - - - - - - - - Relation to store the groups for relations - - - The related relations - - - - - The reference of the related groups from the group table - - - - - diff --git a/mappings/src/main/hbm/transactional/core/CategoryResource.hbm.xml b/mappings/src/main/hbm/transactional/core/CategoryResource.hbm.xml deleted file mode 100644 index 30569ef6d..000000000 --- a/mappings/src/main/hbm/transactional/core/CategoryResource.hbm.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Storage of the categories which should be used to group the data (e.g. grouping of phemomenon). - - - PK column of the table - - - category_seq - - - - - Unique identifier of the category which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - The human readable name of the category. - - - - - A short description of the category - - - - - - - - - - - Storage for internationalizations of categories. - - - PK column of the table - - - category_i18n_seq - - - - - Reference to the category table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the category - - - - - Locale/language specific description of the category - - - - diff --git a/mappings/src/main/hbm/transactional/core/CodespaceResource.hbm.xml b/mappings/src/main/hbm/transactional/core/CodespaceResource.hbm.xml deleted file mode 100644 index 5fb55eabc..000000000 --- a/mappings/src/main/hbm/transactional/core/CodespaceResource.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Storage of codespaces which can be domain specific. - - - PK column of the table - - - codespace_seq - - - - - Name/definition of the codespace, e.g. of a domain - - - - diff --git a/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml b/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml deleted file mode 100644 index 284886617..000000000 --- a/mappings/src/main/hbm/transactional/core/FeatureResource.hbm.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - Storage of the features (OfInterest). A feature represents the observed location, route, or area. As examples, the location of the weather station or the water level location, a ferry (Cuxhaven-Helgoland) or a lake of interest. - - - PK column of the table - - - feature_seq - - - - - - Indicator used by Hibernate to map value specific entities (e.g. of a WaterML 2.0 MonitoringPoint) which are stored in separate tables. - - - - - - Reference to the featureType in the format table. Required by the SOS to identify the typ of the feature, e.g. http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint. - - - - - - Unique identifier of the feature which is used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the feature identifier, reference to the codespace table. - - - - - The human readable name of the feature. - - - - - The codespace of the feature name, reference to the codespace table. - - - - - A short description of the feature - - - - - - The XML encoded representation of the feature. - - - - - - Optional URL to an external resource that describes the feature, e.g. a WFS - - - - - - - - The geometry/location of feature - - - - - - Storage of hierarchies between features - - - Reference to the child feature in feature table. - - - - - Reference to the parent feature in feature table. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of features. - - - PK column of the table - - - feature_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the feature - - - - - Locale/language specific description of the feature - - - - - CREATE INDEX idx_feature_geom ON ${schema}.feature USING gist (geom) - - - - - - diff --git a/mappings/src/main/hbm/transactional/core/FormatResource.hbm.xml b/mappings/src/main/hbm/transactional/core/FormatResource.hbm.xml deleted file mode 100644 index 21d36c9d5..000000000 --- a/mappings/src/main/hbm/transactional/core/FormatResource.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Storage of types (feature, observation) and formats (procedure)., e.g. http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement and http://www.opengis.net/sensorml/2.0 - - - PK column of the table - - - format_seq - - - - - The definition of the format. - - - - diff --git a/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml b/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml deleted file mode 100644 index 96bc10b5a..000000000 --- a/mappings/src/main/hbm/transactional/core/LocationResource.hbm.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - location_seq - - - - - Unique identifier of the location. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - historical_location_seq - - - - - Unique identifier of the HistoricalLocation. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - location_i18n_seq - - - - - Reference to the feature table this internationalization belongs to. - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the location - - - - - Locale/language specific description of the location - - - - - Locale/language specific location property of the location - - - - - diff --git a/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml b/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml deleted file mode 100644 index f7c4c5d25..000000000 --- a/mappings/src/main/hbm/transactional/core/OfferingResource.hbm.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - Storage of the offerings which is required by the SOS. An offering is used in SOS to group records according to specific criteria. In the INSPIRE context, an offering is an "INSPRE spatial dataset," an identifiable collection of spatial data. - - - PK column of the table - - - offering_seq - - - - - Unique identifier of the offering which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321. - - - - - The codespace of the offering identifier, reference to the codespace table. - - - - - The human readable name of the offering. - - - - - The codespace of the offering name, reference to the codespace table. - - - - - A short description of the offering - - - - - - The minimum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum samplingTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum resultTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum resultTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The minimum validTimeStart of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - The maximum validTimeEnd of all observation that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - The envelope/geometry of all features or samplingGeometries of observations that belong to this offering. If the column is empty, the information is calculated during the cache update and stored locally. Used for the capabilities of the SOS. - - - - - - - - Reference to the child offering in offering table. - - - - - Reference to the parent offering in offering table. - - - - - - - - - - - Relation to store the valid observationTypes for the offering - - - The related offering - - - - - The reference of the related observationType from the format table - - - - - - Relation to store the valid featureTypes for the offering - - - The related offering - - - - - The reference of the related featureType from the format table - - - - - - Storage tfor the relation between offering and relatedFeature - - - The related offering - - - - - The reference to the relatedFeature from the relatedFeature table - - - - - - - - - - - - Storage for internationalizations of offerings. - - - PK column of the table - - - offering_i18n_seq - - - - - Reference to the offering table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the offering - - - - - Locale/language specific description of the offering - - - - diff --git a/mappings/src/main/hbm/transactional/core/PhenomenonResource.hbm.xml b/mappings/src/main/hbm/transactional/core/PhenomenonResource.hbm.xml deleted file mode 100644 index 9b01d22a0..000000000 --- a/mappings/src/main/hbm/transactional/core/PhenomenonResource.hbm.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - Storage of the phenomenon/observableProperties, e.g. air temperature, water temperature, ... - - - PK column of the table - - - phenomenon_seq - - - - - - Unique identifier of the phenomenon which can be used for filtering. Should be a URI (reference to a vocabulary entry), UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the phenomenon identifier, reference to the codespace table. - - - - - The human readable name of the phenomenon. - - - - - The codespace of the phenomenon name, reference to the codespace table. - - - - - A short description of the phenomenon - - - - - - - - - - Storage of hierarchies between phenomenon, e.g. for composite phenomenon like weather with temperature, windspeed, ... - - - Reference to the child phenomenon in phenomenon table. - - - - - Reference to the parent phenomenon in phenomenon table. - - - - - - - - - - - - - - - - - - - - - - - - - - Storage for internationalizations of phenomenon. - - - PK column of the table - - - phenomenon_i18n_seq - - - - - Reference to the phenomenon table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the phenomenon - - - - - Locale/language specific description of the phenomenon - - - - diff --git a/mappings/src/main/hbm/transactional/core/ProcedureHistoryResource.hbm.xml b/mappings/src/main/hbm/transactional/core/ProcedureHistoryResource.hbm.xml deleted file mode 100644 index 868443db8..000000000 --- a/mappings/src/main/hbm/transactional/core/ProcedureHistoryResource.hbm.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - Storage of historical procedure descriptions as XML encoded text with period of validity. - - - PK column of the table - - - procedure_history_seq - - - - - Reference to the procedure this entry belongs to. - - - - - Reference to the format of the procedure description, e.g. SensorML 2.0 - - - - - The timestamp from which this procedure description is valid. - - - - - The timestamp until this procedure description is valid. If null, this procedure description is currently valid - - - - - XML representation of this procedure description - - - - diff --git a/mappings/src/main/hbm/transactional/core/ProcedureResource.hbm.xml b/mappings/src/main/hbm/transactional/core/ProcedureResource.hbm.xml deleted file mode 100644 index 3fe2f0297..000000000 --- a/mappings/src/main/hbm/transactional/core/ProcedureResource.hbm.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - procedure_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - procedure_i18n_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/transactional/core/RelatedDataResource.hbm.xml b/mappings/src/main/hbm/transactional/core/RelatedDataResource.hbm.xml deleted file mode 100644 index 9491883e9..000000000 --- a/mappings/src/main/hbm/transactional/core/RelatedDataResource.hbm.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Store the relation of two observation, e.g. one observation depends on other observations to provide context - - - - The reference to the dataset that has a related data/observation - - - - - The reference to the related data/observation - - - - - - Definition of the role of the relation - - - - - URL that point to external information - - - - diff --git a/mappings/src/main/hbm/transactional/core/RelatedDatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/core/RelatedDatasetResource.hbm.xml deleted file mode 100644 index abca900ba..000000000 --- a/mappings/src/main/hbm/transactional/core/RelatedDatasetResource.hbm.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Store the relation of two datasets, e.g. one dataset depends on other datasets to provide context - - - - The reference to the dataset that has a related dataset - - - - - The reference to the related dataset - - - - - - Definition of the role of the relation - - - - - URL that point to external information - - - - diff --git a/mappings/src/main/hbm/transactional/core/RelatedFeatureResource.hbm.xml b/mappings/src/main/hbm/transactional/core/RelatedFeatureResource.hbm.xml deleted file mode 100644 index 145cb15c9..000000000 --- a/mappings/src/main/hbm/transactional/core/RelatedFeatureResource.hbm.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - Storage of relations between offerings and features. This table is used by the SOS to fulfill the standard. - - - PK column of the table - - - related_feature_seq - - - - - Reference to the feature that is related to the offering. - - - - - The role of the related feature. - - - - - - - - - - - - - diff --git a/mappings/src/main/hbm/transactional/core/ResultTemplateResource.hbm.xml b/mappings/src/main/hbm/transactional/core/ResultTemplateResource.hbm.xml deleted file mode 100644 index e81f332e1..000000000 --- a/mappings/src/main/hbm/transactional/core/ResultTemplateResource.hbm.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Storage of templates for the result handling operations - - - PK column of the table - - - result_template_seq - - - - - The offering that is associated with the result template - - - - - The phenomenon that is associated with the result template - - - - - The procedure that is associated with the result template. Can be null if the feature is defined in the structure. - - - - - The feature that is associated with the result template. Can be null if the feature is defined in the structure. - - - - - The category that is associated with the result template - - - - - Unique identifier of the result template used for insertion operation - - - - - - The structure of the result template, should be a XML encoded swe:DataRecord - - - - - The encding of the result template, should be a XML encoded swe:TextEncoding - - - - - - The structure of the result template used for observations, should be a XML encoded swe:DataRecord - - - - - The encding of the result template used for observations, should be a XML encoded swe:TextEncoding - - - - diff --git a/mappings/src/main/hbm/transactional/core/TagResource.hbm.xml b/mappings/src/main/hbm/transactional/core/TagResource.hbm.xml deleted file mode 100644 index 9dbf0ed60..000000000 --- a/mappings/src/main/hbm/transactional/core/TagResource.hbm.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - Storage of the tags which should be used to tag the data. - - - PK column of the table - - - tag_seq - - - - - Unique identifier/name of the tag which can be used for filtering. - - - - - - A short description of the tag - - - - - - - - - - - - - - - - - - - Storage for internationalizations of tags. - - - PK column of the table - - - tag_i18n_seq - - - - - Reference to the tag table this internationalization belongs to. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specification for this entry - - - - - Locale/language specific name of the tag - - - - - Locale/language specific description of the tag - - - - diff --git a/mappings/src/main/hbm/transactional/core/UnitResource.hbm.xml b/mappings/src/main/hbm/transactional/core/UnitResource.hbm.xml deleted file mode 100644 index f6808cc42..000000000 --- a/mappings/src/main/hbm/transactional/core/UnitResource.hbm.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Storage of the units of measurement of the observation values. These may be °C or m as the unit for depth/height information. - - - PK column of the table - - - unit_seq - - - - - The symbol of the unit, e.g. °C or m. - - - - - Human readable name of the unit, e.g degree celsius or meter - - - - - Link/reference to an external description of the unit, e.g. to a vocabulary.. - - - - - - - - - - - Storage for internationalizations of units. - - - PK column of the table - - - unit_i18n_seq - - - - - Reference to the unit table this internationalization belongs to. - - - - - Locale/language specification for this unit. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the unit - - - - diff --git a/mappings/src/main/hbm/transactional/core/VerticalMetadataResource.hbm.xml b/mappings/src/main/hbm/transactional/core/VerticalMetadataResource.hbm.xml deleted file mode 100644 index 2c003ec09..000000000 --- a/mappings/src/main/hbm/transactional/core/VerticalMetadataResource.hbm.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - Storage of meta-information about a profile measurement. These are the orientation (height/depth) and name of the depth/height value as they should be named in the output and the unit of the depth/height value. A value_profile must be defined for each dataset containing profile data. - - - PK column of the table - - - value_profile_seq - - - - - The "orientation" of the vertical values as integer. 1 => above verticalOriginName and -1 => below verticalOriginName - - - - - The vertical origin name of the vertical values, e.g. water surface - - - - - The name of the vertical from values, e.g. from or depthFrom - - - - - The name of the vertical from values, e.g. to or depthTo - - - - - The unit of the vertical value, e.g. m - - - - - - - - - - - - PK column of the table - - - value_profile_i18n_seq - - - - - Reference to the value_profile table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific vertical origin name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - - Locale/language specific verticalTo name of the vertical metadata entity - - - - diff --git a/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml b/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml deleted file mode 100644 index 13091cf39..000000000 --- a/mappings/src/main/hbm/transactional/dataset/DataResource.hbm.xml +++ /dev/null @@ -1,378 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml deleted file mode 100644 index d845b2989..000000000 --- a/mappings/src/main/hbm/transactional/dataset/DatasetResource.hbm.xml +++ /dev/null @@ -1,305 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/transactional/dataset/PlatformResource.hbm.xml b/mappings/src/main/hbm/transactional/dataset/PlatformResource.hbm.xml deleted file mode 100644 index a1ad1553c..000000000 --- a/mappings/src/main/hbm/transactional/dataset/PlatformResource.hbm.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml b/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml deleted file mode 100644 index 8ec43dad6..000000000 --- a/mappings/src/main/hbm/transactional/sampling/DataResource.hbm.xml +++ /dev/null @@ -1,384 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - The id of the sampling this observation belongs to. - - - - - - - - - - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml deleted file mode 100644 index 55a998c2d..000000000 --- a/mappings/src/main/hbm/transactional/sampling/DatasetResource.hbm.xml +++ /dev/null @@ -1,338 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - - - Flag that indicates if this dataset has samplings - - - - Storage of relations between dataset and related samplings - - - The reference to the dataset in the dataset table - - - - - The reference to the sampling in the dataset sampling - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the dataset in the dataset table - - - - - The reference to the measuring program in the dataset measuring program - - - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/transactional/sampling/MeasuringProgram.hbm.xml b/mappings/src/main/hbm/transactional/sampling/MeasuringProgram.hbm.xml deleted file mode 100644 index 018f4b258..000000000 --- a/mappings/src/main/hbm/transactional/sampling/MeasuringProgram.hbm.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - Storage of the measuring program which describes a measurement campaign and summarizes all sampling, time series, etc. - - - PK column of the table - - - measuring_program_seq - - - - - - Unique identifier of the measuring program which would be the ORDER_ID in the output of the REST API. - - - - - - The human readable name or label of the sampling. - - - - - - A short description of the measuring program - - - - - - The producer of the measuring program, e.g. name of a person or an organization - - - - - - The timestamp when the measuring program period has started. - - - - - - The timestamp when the measuring program period has finished. - - - - - - - - - - Storage of relations between dataset and related measuring programs - - - The reference to the measuring program. - - - - - The reference to the dataset in the dataset table - - - - - - - - - - - - - - PK column of the table - - - measuring_program_i18n_seq - - - - - Reference to the measuring program table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the measuring program entity - - - - - Locale/language specific description of the measuring program entity - - - - diff --git a/mappings/src/main/hbm/transactional/sampling/PlatformResource.hbm.xml b/mappings/src/main/hbm/transactional/sampling/PlatformResource.hbm.xml deleted file mode 100644 index a1ad1553c..000000000 --- a/mappings/src/main/hbm/transactional/sampling/PlatformResource.hbm.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/hbm/transactional/sampling/Sampling.hbm.xml b/mappings/src/main/hbm/transactional/sampling/Sampling.hbm.xml deleted file mode 100644 index 8728dfa02..000000000 --- a/mappings/src/main/hbm/transactional/sampling/Sampling.hbm.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - Storage of the Description of a sampling that was performed in a measuring program. - - - PK column of the table - - - sampling_seq - - - - - - Reference to the measuring program to which this sampling belongs. - - - - - - The identifier of the sampling. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - - The human readable name or the label of the sampling. - - - - - - A short description or the COMMENT of the sampling - - - - - - The sampler (e.g. name of a person or an organization) who take the sample. - - - - - - The sampling method used to take the sample - - - - - - The environmental conditions when the sample was made, e.g. sunny, dry, hot - - - - - - The timestamp when the sampling period has started. - - - - - - The timestamp when the sampling period has finished. - - - - - Storage of relations between datasets and related samplings - - - The reference to the sampling in the sampling table. - - - - - The reference to the dataset in the dataset table that provides observations related to the sampling. - - - - - - - - - - - - - - - - - - - PK column of the table - - - sampling_i18n_seq - - - - - Reference to the sampling table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the sampling entity - - - - - Locale/language specific description of the sampling entity - - - - - Locale/language specific sampling method of the sampling entity - - - - - Locale/language specific environmental conditions of the sampling entity - - - - - CREATE or REPLACE FUNCTION insert_dataset_sampling_flag() RETURNS TRIGGER AS $$ BEGIN UPDATE ${schema}.dataset SET is_samplings = 1 WHERE dataset_id = NEW.fk_dataset_id; RETURN NEW; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS insert_dataset_sampling_flag() - - - - - - CREATE or REPLACE FUNCTION delete_dataset_sampling_flag() RETURNS TRIGGER AS $$ DECLARE dataset_count SMALLINT; BEGIN SELECT count(fk_dataset_id) INTO dataset_count FROM ${schema}.sampling_dataset WHERE fk_dataset_id = OLD.fk_dataset_id; IF dataset_count = 0 THEN UPDATE ${schema}.dataset SET is_samplings = 0 WHERE dataset_id = OLD.fk_dataset_id; END IF; RETURN OLD; END $$ LANGUAGE plpgsql - DROP FUNCTION IF EXISTS delete_dataset_sampling_flag() - - - - - - CREATE TRIGGER insert_dataset_sampling_flag AFTER INSERT ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE insert_dataset_sampling_flag() - DROP TRIGGER IF EXISTS insert_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - - CREATE TRIGGER delete_dataset_sampling_flag AFTER DELETE ON ${schema}.sampling_dataset FOR EACH ROW EXECUTE PROCEDURE delete_dataset_sampling_flag() - DROP TRIGGER IF EXISTS delete_dataset_sampling_flag ON ${schema}.sampling_dataset - - - - - diff --git a/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml b/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml deleted file mode 100644 index c8088ade1..000000000 --- a/mappings/src/main/hbm/transactional/staplus/DataResource.hbm.xml +++ /dev/null @@ -1,402 +0,0 @@ - - - - Storage of the observation values with the timestamp and additional metadata. The metadata are height/depth values for profile observation and sampling geometries for trajectory observations. In each observation entry only one value_... column should be filled with a value! - - - PK column of the table - - - observation_seq - - - - - Indicator used by Hibernate to map value specific entities. Valid values are quantity (scalar values in value_quantity), count (integer values in value_count), text (textual values in value_text), category (categorical values in value_category), bool (boolean values in value_boolean), reference (references in value_reference, e.g. link to a source, photo, video) - - - - - - - Reference to the dataset to which this observation belongs. - - - - - - - The timestamp when the observation period has started or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the measurement period has finished or the observation took place. In the the latter, sampling_time_start and sampling_time_end are equal. - - - - - - The timestamp when the observation was published. Might be identical with sampling_time_start and sampling_time_end. - - - - - - Unique identifier of the observation which can be for used filtering, e.g. GetObservationById in the SOS. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the data/observation identifier, reference to the codespace table. Can be null. - - - - - - The human readable name of the observation. - - - - - - The codespace of the data/observation name, reference to the codespace table. Can be null. - - - - - A short description of the observation - - - - - - Flag that indicates if this observation is deleted - - - - - - The timestamp from when the obervation is valid, e.g. forcaste observations - - - - - - The timestamp until when the obervation is valid, e.g. forcaste observations - - - - - - - - The geometry that represents the location where the observation was observed, e.g. mobile observations (trajectories) where this geometry is different from the feature geometry. - - - - - Storage of relations between observation and related parameter - - - - - - - - - - - - - - Identifier of the value. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the name. E.g. used in OGC SWE encoded values like SweText - - - - - Identifier of the description. E.g. used in OGC SWE encoded values like SweText - - - - - - The start level of a vertical observation, required for profile observations - - - - - The end level or the level of a vertical observation, required for profile observations - - - - - - Reference to the parent observation in the case of complex observations like profiles, complex or swedataarray observations. - - - - - - - - - - - - - - - - - - - - - - - - - - Relation to store the groups for observatios - - - The related observations - - - - - The reference of the related groups from the group table - - - - - - - - The quantity value of an observation (Measurement) - - - - - - Flag that indicates if measured value lower/higher of the detection limit. - - - - - The detection limit - - - - - - - - - The textual value of an observation (TextObservation)) - - - - - - - - The reference value (URI) of an observation (ReferenceObservation) - - - - - - - - The count/integer value of an observation (CountObservation) - - - - - - - - The boolean value of an observation (Boolean/TruthObservation) - - - - - - - - The categorical value of an observation (CategoryObervation) - - - - - - - - - - The geometry value of an observation (GeometryObservation) - - - - - - - - Storage of the blog observation value. Separate table because the size of a blob value can be huge. - - - Reference to the data/observation in the observation table - - - - - The blob value of an observation - - - - - - - - - The textual value of an observation (SweDataArrayObservation)) - - - - - - Reference to the parent data/observation - - - - - - - Reference to the result template which holds the structure and encoding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The XML representation of the SensorML20 Observation (SensorML20Observation) - - - - - - - - - PK column of the table - - - observation_i18n_seq - - - - - Reference to the data table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - Locale/language specific name of the data entity - - - - - Locale/language specific description of the data entity - - - - - CREATE INDEX idx_observation_ds_sts ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_start) - - - - - - - CREATE INDEX idx_observation_sts_ds ON ${schema}.observation USING btree (sampling_time_start, fk_dataset_id) - - - - - - - CREATE INDEX idx_observation_ds_ste ON ${schema}.observation USING btree (fk_dataset_id, sampling_time_end) - - - - - - - CREATE INDEX idx_observation_ste_ds ON ${schema}.observation USING btree (sampling_time_end, fk_dataset_id) - - - - - - diff --git a/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml b/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml deleted file mode 100644 index 4e4f99df6..000000000 --- a/mappings/src/main/hbm/transactional/staplus/DatasetResource.hbm.xml +++ /dev/null @@ -1,320 +0,0 @@ - - - - Storage of the dataset, the core table of the whole database model. - - - PK column of the table - - - dataset_seq - - - - - Indicator used by Hibernate to distinguish between different types of datasets. Used e.g. for STA DatasetAggregations. - - - - - Unique identifier of the dataset which can be used for filtering, e.g. GetObservationById in the SOS and can be encoded in WaterML 2.0 oder TimeseriesML 1.0 outputs. - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The human readable name of the dataset. - - - - - A short description of the dataset - - - - - The timestamp of the temporally first observation that belongs to this dataset. - - - - - The timestamp of the temporally last observation that belongs to this dataset. - - - - - The timestamp of the earliest result time of the observations that belong to this dataset. - - - - - The timestamp of the latest result time of the observations that belong to this dataset. - - - - - - - - - - Reference to the procedure that belongs that belongs to this dataset. - - - - - Reference to the phenomenon that belongs that belongs to this dataset. - - - - - Reference to the offering that belongs that belongs to this dataset. - - - - - Reference to the category that belongs that belongs to this dataset. - - - - - Reference to the feature that belongs that belongs to this dataset. - - - - - Reference to the platform that belongs that belongs to this dataset. - - - - - Reference to the unit of the observations that belongs to this dataset. - - - - - Reference to the party of the observations that belongs to this dataset. - - - - - Reference to the project of the observations that belongs to this dataset. - - - - - Reference to the license of the observations that belongs to this dataset. - - - - - Reference to the observationType in the format table. Required by the SOS to persist the valid observationType for the dataset. - - - - - Reference to the aggregation if this dataset belongs to one. - - - - - The value of the temporally first observation that belongs to this dataset. - - - - - The value of the temporally last quantity observation that belongs to this dataset. - - - - - Reference to the temporally first observation in the observation table that belongs to this dataset. - - - - - Reference to the temporally last observation in the observation table that belongs to this dataset. - - - - - - - - - - - - - - - - - - - Indicator whether the dataset provides individualObservation (individual observations), timeseries (timeseries obervations) or trajectories (trajectory observations). - - - org.n52.series.db.beans.dataset.DatasetType - true - - - - - Indicator whether the dataset observations are of type simple (a simple observation, e.g. a scalar value like the temperature) or profile (profile observations) - - - org.n52.series.db.beans.dataset.ObservationType - true - - - - - Indicator of the type of the single values. Valid values are quantity (scalar values), count (integer values), text (textual values), category (categorical values), bool (boolean values), reference (references, e.g. link to a source, photo, video) - - - org.n52.series.db.beans.dataset.ValueType - true - - - - - Flag that indicates if this dataset is deleted - - - - - Flag that indicates if this dataset is disabled for insertion of new data - - - - - Flag that indicates if this dataset should be published - - - - - Flag that indicates if the procedure is mobile (1/true) or stationary (0/false). - - - - - Flag that indicates if the procedure is insitu (1/true) or remote (0/false). - - - - - Flag that indicates if this dataset should be hidden, e.g. for sub-datasets of a complex datasets - - - - - Define the origin timezone of the dataset timestamps. Possible values are offset (+02:00), id (CET) or full name (Europe/Berlin). It no time zone is defined, UTC would be used as default. - - - - - Number of decimals that should be present in the output of the observation values. If no value is set, all decimals would be present. - - - - Storage of reference datasets, e.g. level zero, medium water level,etc. for water level. - - - Reference to the dataset that has reference datasets - - - - - Provides the sort order for the reference datasets. - - - - - Reference to the dataset that belongs to another dataset and provides values like level zero, medium water level,etc. for water level. - - - - - - The codespace of the dataset identifier, reference to the codespace table. Can be null. - - - - - The codespace of the dataset name, reference to the codespace table. Can be null. - - - - - Reference to the vertical metadata that belongs to this profile dataset. - - - - Storage of relations between dataset and related tags - - - The reference to the dataset in the dataset table - - - - - The reference to the tags in the tag dataset table - - - - - - - - - - - - - - PK column of the table - - - dataset_i18n_seq - - - - - Reference to the dataset table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the dataset entity - - - - - Locale/language specific description of the dataset entity - - - - - CREATE INDEX idx_dataset_ts_s_cq ON ${schema}.dataset USING btree (dataset_type, observation_type, value_type, is_deleted, is_published, first_time, last_time) WHERE is_deleted = 0 AND is_published = 1 AND first_time IS NOT NULL AND last_time IS NOT NULL AND dataset_type = 'timeseries' AND observation_type = 'simple' AND value_type IN ('count', 'quantity') - - - - - - diff --git a/mappings/src/main/hbm/transactional/staplus/PlatformResource.hbm.xml b/mappings/src/main/hbm/transactional/staplus/PlatformResource.hbm.xml deleted file mode 100644 index f513e0f66..000000000 --- a/mappings/src/main/hbm/transactional/staplus/PlatformResource.hbm.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - Storage of the platforms. With a platform several procedures can be grouped or in the case of citizen science the platform can be the camera or mobile phone. An example of a platform is a vessel that has multiple sensors (Procedure). In most cases, the platform is the same as the platform or procedure, such as a weather station or a water level location. - - - PK column of the table - - - platform_seq - - - - - Unique identifier of the platform which can be used for filtering. Should be a URI, UUID. E.g. http://www.example.org/123, 123-321 - - - - - Unique identifier used by SensorThingsAPI for addressing the entity. Should be a URI (reference to a vocabulary entry), UUID. E.g. 123, 123-321 - - - - - The codespace of the platform identifier, reference to the codespace table. - - - - - The human readable name of the platform. - - - - - The codespace of the platform name, reference to the codespace table. - - - - - A short description of the platform - - - - - Reference to the party of the platform. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PK column of the table - - - platform_i18n_seq - - - - - Reference to the platform table this internationalization belongs to. - - - - - Locale/language specification for this entry. ISO 639 Codes (http://www.loc.gov/standards/iso639-2/php/code_list.php) - - - - - Locale/language specific name of the platform - - - - - Locale/language specific description of the platform - - - - diff --git a/mappings/src/main/resources/hibernate.cfg.xml b/mappings/src/main/resources/hibernate.cfg.xml index 0a809a412..981c86b02 100644 --- a/mappings/src/main/resources/hibernate.cfg.xml +++ b/mappings/src/main/resources/hibernate.cfg.xml @@ -3,19 +3,8 @@ "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> - org.hibernate.transaction.JDBCTransactionFactory thread - org.hibernate.cache.NoCacheProvider 1 RECREATE_QUIETLY - true - - - - diff --git a/mappings/src/main/resources/orm/proxy/service.orm.xml b/mappings/src/main/resources/orm/proxy/service.orm.xml deleted file mode 100644 index 9562c9569..000000000 --- a/mappings/src/main/resources/orm/proxy/service.orm.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index 466c60030..9bf58ecec 100644 --- a/pom.xml +++ b/pom.xml @@ -95,21 +95,11 @@ db-model-mappings ${project.version} - - ${project.groupId} - db-model-generator - ${project.version} - ${project.groupId} db-model-types ${project.version} - - ${project.groupId} - db-model-dialects - ${project.version} - org.postgresql postgresql