Issue #2060 fix grid updates and performance
Change-Id: I0937d7360e456f08fb613be547f7b488ebe05b50 Former-commit-id:c71edb2d4c
[formerlye39378e5f0
] [formerlyacfbce58d1
[formerly a430e85f283b3e41b8520d241f675eff3c6c32e3]] Former-commit-id:acfbce58d1
Former-commit-id:5099fd6463
This commit is contained in:
parent
e58fa39adc
commit
81b914ad9f
4 changed files with 13 additions and 61 deletions
|
@ -36,7 +36,6 @@ import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
|||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||
import com.raytheon.uf.common.gridcoverage.convert.GridCoverageConverter;
|
||||
import com.raytheon.uf.common.parameter.Parameter;
|
||||
import com.raytheon.uf.common.parameter.ParameterConverter;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -107,7 +106,7 @@ public class GridInfoRecord extends PersistableDataObject<Integer> {
|
|||
|
||||
@ManyToOne
|
||||
@PrimaryKeyJoinColumn
|
||||
@DataURI(position = 4, converter = ParameterConverter.class)
|
||||
@DataURI(position = 4, embedded = true)
|
||||
@DynamicSerializeElement
|
||||
private Parameter parameter;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.raytheon.uf.common.geospatial.ISpatialEnabled;
|
|||
import com.raytheon.uf.common.geospatial.ISpatialObject;
|
||||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||
import com.raytheon.uf.common.parameter.Parameter;
|
||||
import com.raytheon.uf.common.parameter.lookup.ParameterLookup;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -66,6 +67,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Dec 16, 2013 2574 bsteffen Remove getDecoderGettable.
|
||||
* Apr 15, 2014 2060 njensen Remove dataURI column
|
||||
* May 07, 2014 2060 njensen GridRecord(String) will do parameter lookup
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -117,6 +119,14 @@ public class GridRecord extends PersistablePluginDataObject implements
|
|||
|
||||
public GridRecord(String uri) {
|
||||
super(uri);
|
||||
String abbrev = this.getInfo().getParameter().getAbbreviation();
|
||||
if (abbrev != null) {
|
||||
Parameter paramWithUnits = ParameterLookup.getInstance()
|
||||
.getParameter(abbrev);
|
||||
if (paramWithUnits != null) {
|
||||
this.getInfo().setParameter(paramWithUnits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GridInfoRecord getInfo() {
|
||||
|
|
|
@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
@ -70,6 +71,7 @@ public class Parameter extends PersistableDataObject implements
|
|||
@Id
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
@DataURI(position = 0)
|
||||
private String abbreviation;
|
||||
|
||||
@Column(nullable = false)
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.parameter;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURIFieldConverter;
|
||||
import com.raytheon.uf.common.parameter.lookup.ParameterLookup;
|
||||
|
||||
/**
|
||||
* A DataURIFieldConverter that ensures that a String parameter abbreviation
|
||||
* will be looked up to potentially contain all the fields.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 6, 2014 2060 njensen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ParameterConverter implements DataURIFieldConverter<Parameter> {
|
||||
|
||||
@Override
|
||||
public String toString(Parameter field) {
|
||||
return field.getAbbreviation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Parameter fromString(String string) {
|
||||
Parameter p = ParameterLookup.getInstance().getParameter(string);
|
||||
if (p == null) {
|
||||
p = new Parameter(string);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue