From fabbc29fe8d05b43712ec3b64f02bc499806470c Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Tue, 14 May 2013 18:13:44 -0500 Subject: [PATCH] Issue #1869 Remove DataURI column from bufrmos. Change-Id: Ic1a25588a45c2dc8a1a089332a4d6a33c41e205e Former-commit-id: 5b740e5d614d9cac2476335a0754ccd0e1185c84 --- deltaScripts/13.5.1/dropDataURI.sh | 43 +++++++++--- .../edex/plugin/bufrmos/BufrMosDecoder.java | 8 +-- .../plugin/bufrmos/common/BufrMosAvnData.java | 19 ++--- .../plugin/bufrmos/common/BufrMosData.java | 70 ++----------------- .../plugin/bufrmos/common/BufrMosEtaData.java | 17 ++--- .../plugin/bufrmos/common/BufrMosGfsData.java | 16 ++--- .../plugin/bufrmos/common/BufrMosHpcData.java | 19 ++--- .../bufrmos/common/BufrMosLampData.java | 19 ++--- .../plugin/bufrmos/common/BufrMosMrfData.java | 19 ++--- .../plugin/bufrmos/common/BufrMosNgmData.java | 19 ++--- .../dataplugin/gfe/db/objects/GFERecord.java | 6 -- 11 files changed, 89 insertions(+), 166 deletions(-) mode change 100755 => 100644 edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/BufrMosDecoder.java diff --git a/deltaScripts/13.5.1/dropDataURI.sh b/deltaScripts/13.5.1/dropDataURI.sh index 22ce1f3eda..3cf3c466da 100644 --- a/deltaScripts/13.5.1/dropDataURI.sh +++ b/deltaScripts/13.5.1/dropDataURI.sh @@ -4,16 +4,43 @@ PSQL="/awips2/psql/bin/psql" -echo "INFO: Dropping dataURI columns." - -# TODO this script will need to be extended for unique constraint. -for table in gfe; -do - echo "INFO: Dropping DataURI column from $table" - ${PSQL} -U awips -d metadata -c "ALTER TABLE $table DROP COLUMN IF EXISTS datauri;" +# takes one arg: a table name +# 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 COLUMN IF EXISTS datauri;" if [ $? -ne 0 ]; then echo "ERROR: Failed to drop dataURI column for $table" echo "FATAL: The update has failed." exit 1 fi -done \ No newline at end of file +} + +# takes three args: table, constraint name, unique columns +# will first drop the constraint if it exists and then adds it back, this is +# fairly inefficient if it does exist but operationally it won't exist and for +# testing this allows the script to be run easily as a noop. +function dropDatauriAndAddConstraint { + dropDatauri $1 + ${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS $2;" + ${PSQL} -U awips -d metadata -c "ALTER TABLE $1 ADD CONSTRAINT $2 UNIQUE $3;" + if [ $? -ne 0 ]; then + echo "ERROR: Failed to add new unique constraint for $table" + echo "FATAL: The update has failed." + exit 1 + fi +} + +echo "INFO: Dropping dataURI columns." + +dropDatauri 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/BufrMosDecoder.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/BufrMosDecoder.java old mode 100755 new mode 100644 index 4ae5cbf7e2..e6963d3f55 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/BufrMosDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/BufrMosDecoder.java @@ -52,9 +52,10 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080221 862 jkorman Initial Coding. - * 20080408 1039 jkorman Added traceId for tracing data. - * 12/08/08 chammack Camel Refactor + * Feb 21, 2008 862 jkorman Initial Coding. + * Apr 08, 2008 1039 jkorman Added traceId for tracing data. + * Dec 08, 2008 chammack Camel Refactor + * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @author jkorman @@ -109,7 +110,6 @@ public class BufrMosDecoder extends AbstractDecoder { if (fcstData != null) { fcstData.setTraceId(traceId); fcstData.setPersistenceTime(new Date()); - fcstData.constructDataURI(); pdoList.add(fcstData); } } catch (Exception e) { diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosAvnData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosAvnData.java index fb067c5213..630af09cbb 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosAvnData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosAvnData.java @@ -19,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosAvnseq") -@Table(name = "bufrmosAvn", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosAvn", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -77,11 +77,4 @@ public class BufrMosAvnData extends BufrMosData { return MOSType.AVN; } - @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/BufrMosData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java index 49cf78e3dd..4e3febcf4b 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java @@ -19,8 +19,6 @@ **/ package com.raytheon.edex.plugin.bufrmos.common; -import java.util.Collection; - import javax.persistence.CascadeType; import javax.persistence.Embedded; import javax.persistence.Inheritance; @@ -36,7 +34,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURIConfig; @@ -56,11 +53,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080221 862 jkorman Initial Coding. - * 02/06/09 1990 bphillip removed populateDataStore method + * Feb 21, 2008 862 jkorman Initial Coding. + * Feb 06, 2009 1990 bphillip removed populateDataStore method * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 02, 2013 1970 bgonzale Removed Table annotation, changed from Entity - * annotation to MappedSuperClass. + * May 02, 2013 1970 bgonzale Removed Table annotation, changed from + * Entity annotation to MappedSuperClass. + * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. * * * @@ -75,7 +73,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @DynamicSerialize @DataURIConfig(persistentIndex = 2) public abstract class BufrMosData extends PersistablePluginDataObject implements - IDecoderGettable, IPersistable, IPointData { + IPersistable, IPointData { public static enum MOSType { ETA, GFS, AVN, LAMP, HPC, MRF, NGM @@ -178,62 +176,6 @@ public abstract class BufrMosData extends PersistablePluginDataObject implements identifier = dataURI; } - /** - * @see com.raytheon.uf.common.dataplugin.PluginDataObject#getDecoderGettable() - */ - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - /** - * @see com.raytheon.uf.common.dataplugin.IDecoderGettable#getString(java.lang.String) - */ - @Override - public String getString(String paramName) { - return null; - } - - /** - * @see com.raytheon.uf.common.dataplugin.IDecoderGettable#getStrings(java.lang.String) - */ - @Override - public String[] getStrings(String paramName) { - return null; - } - - /** - * @see com.raytheon.uf.common.dataplugin.IDecoderGettable#getValue(java.lang.String) - */ - @Override - public Amount getValue(String paramName) { - - Amount retValue = null; - - // Object element = elementMap.get(paramName); - // TODO: - // if (element != null) { - // Unit units = BUFRTableB.mapUnits(element.getUnits()); - // if (units != null) { - // if ("FLOAT".equals(element.getElementType())) { - // retValue = new Amount(element.getDoubleVal(), units); - // } else if ("INTEGER".equals(element.getElementType())) { - // retValue = new Amount(element.getIntegerVal(), units); - // } - // } - // } - - return retValue; - } - - /** - * @see com.raytheon.uf.common.dataplugin.IDecoderGettable#getValues(java.lang.String) - */ - @Override - public Collection getValues(String paramName) { - return null; - } - public BufrMosDataLocation getLocation() { return location; } 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 fe9f5b155a..a258ff0221 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,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosEtaseq") -@Table(name = "bufrmosEta", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosEta", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -77,11 +77,4 @@ 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 d6c6585508..ca5123127c 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,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosGfsseq") -@Table(name = "bufrmosGfs", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosGfs", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -77,10 +77,4 @@ 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/BufrMosHpcData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosHpcData.java index 32e9dcf21b..9ee9929ef8 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosHpcData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosHpcData.java @@ -19,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosHpcseq") -@Table(name = "bufrmosHpc", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosHpc", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,10 +76,5 @@ public class BufrMosHpcData extends BufrMosData { public MOSType getType() { return MOSType.HPC; } - @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 707d166d77..c6d1331d97 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,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosLampseq") -@Table(name = "bufrmosLamp", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosLamp", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,10 +76,5 @@ 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 ffc865f2f4..b9dd2ab11f 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,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosMrfseq") -@Table(name = "bufrmosMrf", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosMrf", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,10 +76,5 @@ 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 b2982de3cf..340eb1505a 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,9 +19,6 @@ **/ 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; @@ -45,10 +42,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 25, 2011 rjpeter Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 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. * * * @@ -57,7 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrmosNgmseq") -@Table(name = "bufrmosNgm", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "bufrmosNgm", uniqueConstraints = { @UniqueConstraint(columnNames = { + "location_id", "refTime", "forecastTime" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -76,10 +76,5 @@ public class BufrMosNgmData extends BufrMosData { public MOSType getType() { return MOSType.NGM; } - @Override - @Column - @Access(AccessType.PROPERTY) - public String getDataURI() { - return super.getDataURI(); - } + } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java index 7e08dc0e3f..a2ed4c60bf 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java @@ -44,7 +44,6 @@ import org.hibernate.annotations.Index; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; @@ -193,11 +192,6 @@ public class GFERecord extends PluginDataObject { super(uri); } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - public void setGridHistory(GridDataHistory[] history) { setGridHistory(Arrays.asList(history)); }