Issue #2616 - Set overwrite allowed flag on madis records when decoded

Added delta script for table MADIS with the hibernate generated key name

Change-Id: Id8cfee5bfba68aa686b9d998bdbf85e5de5c7519

Former-commit-id: 5a42580c2b [formerly b3a18fd5270f2ce109b0560fba6e11e76e721bc9]
Former-commit-id: 9a02ae7d68
This commit is contained in:
Mike Duff 2013-12-09 14:11:58 -06:00
parent 997c575919
commit 1a0893d70e
4 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,3 @@
alter table madis drop constraint madis_location_reftime_provider_subprovider_restriction_key;
alter table madis add constraint madis_location_stationid_reftime_provider_subprovider_restr_key UNIQUE (location, stationid, reftime, provider, subprovider, restriction)

View file

@ -0,0 +1,5 @@
#!/bin/bash
PSQL=/awips2/psql/bin/psql
DIR=`dirname $0`
${PSQL} -U awips -d metadata -f ${DIR}/updateMadisTableConstraint.sql

View file

@ -73,6 +73,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Jul 14, 2013 2180 dhladky GUI update for mouse over display * Jul 14, 2013 2180 dhladky GUI update for mouse over display
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 14, 2013 2361 njensen Removed IDecoderGettable * Oct 14, 2013 2361 njensen Removed IDecoderGettable
* Dec 10, 2013 2616 mpduff Added stationId to the unique constraint
* *
* </pre> * </pre>
* *
@ -83,7 +84,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "madisseq") @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "madisseq")
@Table(name = "madis", uniqueConstraints = { @UniqueConstraint(columnNames = { @Table(name = "madis", uniqueConstraints = { @UniqueConstraint(columnNames = {
"location", "refTime", "provider", "subProvider", "restriction" }) }) "location", "stationId", "refTime", "provider", "subProvider", "restriction" }) })
@org.hibernate.annotations.Table(appliesTo = "madis", indexes = { @Index(name = "madis_wfsQueryIndex", columnNames = { @org.hibernate.annotations.Table(appliesTo = "madis", indexes = { @Index(name = "madis_wfsQueryIndex", columnNames = {
"refTime", "location" }), }) "refTime", "location" }), })
@DynamicSerialize @DynamicSerialize

View file

@ -55,6 +55,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Mar 27, 2013 1746 dhladky Initial creation * Mar 27, 2013 1746 dhladky Initial creation
* Jun 17, 2013 2113 dhladky QPID memory usage alleviation * Jun 17, 2013 2113 dhladky QPID memory usage alleviation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Dec 10, 2013 2616 mpduff Set overwrite allowed on MadisRecord.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -140,6 +141,7 @@ public class MadisDecoder extends AbstractDecoder {
long time3 = System.currentTimeMillis(); long time3 = System.currentTimeMillis();
MadisRecord rec = processMadis(headerType, line); MadisRecord rec = processMadis(headerType, line);
rec.setOverwriteAllowed(true);
long time4 = System.currentTimeMillis(); long time4 = System.currentTimeMillis();
statusHandler.handle(Priority.DEBUG, statusHandler.handle(Priority.DEBUG,
"MADIS record decode time: " + (time4 - time3) "MADIS record decode time: " + (time4 - time3)