diff --git a/deltaScripts/13.5.1/dropDataURI.sh b/deltaScripts/13.5.1/dropDataURI.sh index 3cf3c466da..1ec61a59f2 100644 --- a/deltaScripts/13.5.1/dropDataURI.sh +++ b/deltaScripts/13.5.1/dropDataURI.sh @@ -8,7 +8,7 @@ PSQL="/awips2/psql/bin/psql" # drops the datauri constraint and column if they exist function dropDatauri { echo "INFO: Dropping DataURI column from $1" - ${PSQL} -U awips -d metadata -c "ALTER TABLE $1 CONSTRAINT IF EXISTS ${1}_datauri_key;" + ${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS ${1}_datauri_key;" ${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP COLUMN IF EXISTS datauri;" if [ $? -ne 0 ]; then echo "ERROR: Failed to drop dataURI column for $table" @@ -30,17 +30,14 @@ function dropDatauriAndAddConstraint { echo "FATAL: The update has failed." exit 1 fi + ${PSQL} -U awips -d metadata -c "VACUUM FULL $1" } echo "INFO: Dropping dataURI columns." dropDatauri gfe +${PSQL} -U awips -d metadata -c "VACUUM FULL gfe" dropDatauriAndAddConstraint bufrmosavn bufrmosavn_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" -dropDatauriAndAddConstraint bufrmoseta bufrmoseta_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" -dropDatauriAndAddConstraint bufrmosgfs bufrmosgfs_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" dropDatauriAndAddConstraint bufrmoshpc bufrmoshpc_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" -dropDatauriAndAddConstraint bufrmoslamp bufrmoslamp_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" -dropDatauriAndAddConstraint bufrmosmrf bufrmosmrf_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" -dropDatauriAndAddConstraint bufrmosngm bufrmosngm_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" echo "INFO: dataURI columns dropped successfully" diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosEtaData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosEtaData.java index a258ff0221..fe9f5b155a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosEtaData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosEtaData.java @@ -19,6 +19,9 @@ **/ package com.raytheon.edex.plugin.bufrmos.common; +import javax.persistence.Access; +import javax.persistence.AccessType; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @@ -42,12 +45,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 04, 2013 1846 bkowal Added an index on refTime and - * forecastTime + * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @@ -56,8 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosEtaseq") -@Table(name = "bufrmosEta", uniqueConstraints = { @UniqueConstraint(columnNames = { - "location_id", "refTime", "forecastTime" }) }) +@Table(name = "bufrmosEta", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -77,4 +77,11 @@ public class BufrMosEtaData extends BufrMosData { return MOSType.ETA; } + @Override + @Column + @Access(AccessType.PROPERTY) + public String getDataURI() { + return super.getDataURI(); + } + } diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosGfsData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosGfsData.java index ca5123127c..d6c6585508 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosGfsData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosGfsData.java @@ -19,6 +19,9 @@ **/ package com.raytheon.edex.plugin.bufrmos.common; +import javax.persistence.Access; +import javax.persistence.AccessType; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @@ -42,12 +45,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 04, 2013 1846 bkowal Added an index on refTime and - * forecastTime + * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @@ -56,8 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosGfsseq") -@Table(name = "bufrmosGfs", uniqueConstraints = { @UniqueConstraint(columnNames = { - "location_id", "refTime", "forecastTime" }) }) +@Table(name = "bufrmosGfs", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -77,4 +77,10 @@ public class BufrMosGfsData extends BufrMosData { return MOSType.GFS; } + @Override + @Column + @Access(AccessType.PROPERTY) + public String getDataURI() { + return super.getDataURI(); + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosLampData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosLampData.java index c6d1331d97..707d166d77 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosLampData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosLampData.java @@ -19,6 +19,9 @@ **/ package com.raytheon.edex.plugin.bufrmos.common; +import javax.persistence.Access; +import javax.persistence.AccessType; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @@ -42,12 +45,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 04, 2013 1846 bkowal Added an index on refTime and - * forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @@ -56,8 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosLampseq") -@Table(name = "bufrmosLamp", uniqueConstraints = { @UniqueConstraint(columnNames = { - "location_id", "refTime", "forecastTime" }) }) +@Table(name = "bufrmosLamp", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,5 +76,10 @@ public class BufrMosLampData extends BufrMosData { public MOSType getType() { return MOSType.LAMP; } - + @Override + @Column + @Access(AccessType.PROPERTY) + public String getDataURI() { + return super.getDataURI(); + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosMrfData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosMrfData.java index b9dd2ab11f..ffc865f2f4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosMrfData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosMrfData.java @@ -19,6 +19,9 @@ **/ package com.raytheon.edex.plugin.bufrmos.common; +import javax.persistence.Access; +import javax.persistence.AccessType; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @@ -42,12 +45,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 04, 2013 1846 bkowal Added an index on refTime and - * forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @@ -56,8 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosMrfseq") -@Table(name = "bufrmosMrf", uniqueConstraints = { @UniqueConstraint(columnNames = { - "location_id", "refTime", "forecastTime" }) }) +@Table(name = "bufrmosMrf", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,5 +76,10 @@ public class BufrMosMrfData extends BufrMosData { public MOSType getType() { return MOSType.MRF; } - + @Override + @Column + @Access(AccessType.PROPERTY) + public String getDataURI() { + return super.getDataURI(); + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosNgmData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosNgmData.java index 340eb1505a..b2982de3cf 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosNgmData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosNgmData.java @@ -19,6 +19,9 @@ **/ package com.raytheon.edex.plugin.bufrmos.common; +import javax.persistence.Access; +import javax.persistence.AccessType; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @@ -42,12 +45,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 04, 2013 1846 bkowal Added an index on refTime and - * forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @@ -56,8 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosNgmseq") -@Table(name = "bufrmosNgm", uniqueConstraints = { @UniqueConstraint(columnNames = { - "location_id", "refTime", "forecastTime" }) }) +@Table(name = "bufrmosNgm", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,5 +76,10 @@ public class BufrMosNgmData extends BufrMosData { public MOSType getType() { return MOSType.NGM; } - + @Override + @Column + @Access(AccessType.PROPERTY) + public String getDataURI() { + return super.getDataURI(); + } }