Merge "Omaha #4360 DataURI changes for table bufrssmi." into omaha_16.2.1

Former-commit-id: c9cdcebb25e351dba9603741420569b21fa8a0ed
This commit is contained in:
Richard Peter 2015-07-17 13:37:03 -05:00 committed by Gerrit Code Review
commit c489e96c58
2 changed files with 28 additions and 4 deletions

View file

@ -0,0 +1,21 @@
#!/bin/bash
# DR #4360 - this update script will alter the dataURI columns from bufrssmi
PSQL="/awips2/psql/bin/psql"
cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh
table=bufrssmi
# table and constraint names form BufrMTHDWObs.
echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=satid
echo "INFO: Update ${table}'s ${col}"
# The IDecoderConstants.VAL_MISSING used by SSMIDataAdapter.
${PSQL} -U awips -d metadata -c "UPDATE ${table} SET ${col}=-9999998 where ${col} is NULL ; "
updateNotNullCol ${table} ${col}
echo "INFO: ${table} dataURI columns updated successfully"

View file

@ -63,6 +63,7 @@ import com.vividsolutions.jts.geom.Geometry;
* types.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* May 12, 2014 3133 njensen Use TimeUtil instead of TimeTools
* Jul 17, 2015 4360 rferrel Named unique constraint and satIde no longer nullable.
*
* </pre>
*
@ -71,7 +72,7 @@ import com.vividsolutions.jts.geom.Geometry;
*/
@Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrssmiseq")
@Table(name = "bufrssmi", uniqueConstraints = { @UniqueConstraint(columnNames = {
@Table(name = "bufrssmi", uniqueConstraints = { @UniqueConstraint(name = "uk_bufrssmi_datauri_fields", columnNames = {
"stationid", "refTime", "satId", "latitude", "longitude" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
@ -86,10 +87,12 @@ public class SSMIScanData extends PersistablePluginDataObject implements
private static final long serialVersionUID = 1L;
@DataURI(position = 1)
@Column(nullable = false)
@XmlAttribute
@DynamicSerializeElement
private Integer satId;
private int satId;
// TODO Update once SurfaceObsLocation DataURI's are corrected.
@Embedded
@DataURI(position = 2, embedded = true)
@DynamicSerializeElement
@ -188,7 +191,7 @@ public class SSMIScanData extends PersistablePluginDataObject implements
/**
* @return the satId
*/
public Integer getSatId() {
public int getSatId() {
return satId;
}
@ -196,7 +199,7 @@ public class SSMIScanData extends PersistablePluginDataObject implements
* @param satId
* the satId to set
*/
public void setSatId(Integer satId) {
public void setSatId(int satId) {
this.satId = satId;
}