Omaha #4360 DataURI colum changes for bufrascat

Change-Id: Iab4dc4b429f19637570b0a7e0037b685dc169414

Former-commit-id: 8d6032d4ddc5f34ffd72ecdf8a52e75bbcf33b78
This commit is contained in:
Roger Ferrel 2015-07-16 13:56:33 -05:00
parent 09a64ba7e9
commit 59995efc8e
2 changed files with 35 additions and 5 deletions

View file

@ -0,0 +1,25 @@
#!/bin/bash
# DR #4360 - this update script will alter the dataURI columns from bufrascat
PSQL="/awips2/psql/bin/psql"
cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh
table=bufrascat
# table and constraint names form AScatObs.
echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=windSpd
echo "INFO: Update ${table}'s ${col}"
${PSQL} -U awips -d metadata -c "UPDATE ${table} SET ${col}=-9999 where ${col} is NULL ; "
updateNotNullCol ${table} ${col}
col=satId
echo "Info Update ${table}'s ${col}"
${PSQL} -U awips -d metadata -c "UPDATE ${table} SET ${col}=0 where ${col} is NULL ; "
updateNotNullCol ${table} ${col}
echo "INFO: ${table} dataURI columns updated successfully"

View file

@ -61,6 +61,8 @@ import com.vividsolutions.jts.geom.Geometry;
* May 17, 2013 1869 bsteffen Remove DataURI column from sat plot
* types.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Jul 16, 2015 4360 rferrel Convert satId to int, wndSpd to float
* and give name to unique constraint.
*
* </pre>
*
@ -69,7 +71,7 @@ import com.vividsolutions.jts.geom.Geometry;
*/
@Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "bufrascatseq")
@Table(name = "bufrascat", uniqueConstraints = { @UniqueConstraint(columnNames = {
@Table(name = "bufrascat", uniqueConstraints = { @UniqueConstraint(name = "uk_bufrascat_datauri_fields", columnNames = {
"stationid", "refTime", "satId", "latitude", "longitude" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
@ -89,8 +91,10 @@ public class AScatObs extends PersistablePluginDataObject implements
@DataURI(position = 1)
@DynamicSerializeElement
private Integer satId;
@Column(nullable = false)
private int satId;
// TODO Update once SurfaceObsLocation DataURI's are corrected.
@Embedded
@DataURI(position = 2, embedded = true)
@DynamicSerializeElement
@ -115,8 +119,9 @@ public class AScatObs extends PersistablePluginDataObject implements
private Double windDir;
@DataURI(position = 3)
@Column(nullable = false)
@DynamicSerializeElement
private Float windSpd;
private float windSpd;
@DynamicSerializeElement
@Transient
@ -208,7 +213,7 @@ public class AScatObs extends PersistablePluginDataObject implements
/**
* @return the satId
*/
public Integer getSatId() {
public int getSatId() {
return satId;
}
@ -216,7 +221,7 @@ public class AScatObs extends PersistablePluginDataObject implements
* @param satId
* the satId to set
*/
public void setSatId(Integer satId) {
public void setSatId(int satId) {
this.satId = satId;
}