Merge "Omaha #3720 Remove dataURI column references from redbook" into omaha_14.4.1
Former-commit-id:13096c2eaa
[formerly13096c2eaa
[formerly add132c7f2baf5b421590827559b99954133be76]] Former-commit-id:9fe7950e24
Former-commit-id:751d88442c
This commit is contained in:
commit
6b094ebc5a
2 changed files with 23 additions and 5 deletions
|
@ -69,6 +69,8 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
* Mar 13, 2014 2907 njensen split edex.redbook plugin into common and
|
||||
* edex redbook plugins
|
||||
* Oct 10, 2014 3720 mapeters Removed dataURI column.
|
||||
* Oct 28, 2014 3720 mapeters Added refTime and forecastTime to unique
|
||||
* constraints.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,8 +80,8 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "redbookseq")
|
||||
@Table(name = "redbook", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
"wmoTTAAii", "corIndicator", "fcstHours", "productId", "fileId",
|
||||
"originatorId" }) })
|
||||
"refTime", "forecastTime", "wmoTTAAii", "corIndicator", "fcstHours",
|
||||
"productId", "fileId", "originatorId" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.common.time.util.ITimer;
|
|||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.wmo.WMOHeader;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginFactory;
|
||||
import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||
import com.raytheon.uf.edex.plugin.redbook.dao.RedbookDao;
|
||||
import com.raytheon.uf.edex.plugin.redbook.decoder.RedbookParser;
|
||||
|
||||
|
@ -61,6 +62,8 @@ import com.raytheon.uf.edex.plugin.redbook.decoder.RedbookParser;
|
|||
* Mar 13, 2014 2907 njensen split edex.redbook plugin into common and
|
||||
* edex redbook plugins
|
||||
* May 14, 2014 2536 bclement moved WMO Header to common
|
||||
* Oct 24, 2014 3720 mapeters Identify existing records using unique
|
||||
* constraints instead of dataURI.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -198,13 +201,26 @@ public class RedbookDecoder extends AbstractDecoder {
|
|||
|
||||
private RedbookRecord createdBackDatedVersionIfNeeded(RedbookRecord record) {
|
||||
RedbookDao dao;
|
||||
RedbookRecord existingRecord;
|
||||
RedbookRecord existingRecord = null;
|
||||
|
||||
try {
|
||||
dao = (RedbookDao) PluginFactory.getInstance().getPluginDao(
|
||||
PLUGIN_NAME);
|
||||
existingRecord = (RedbookRecord) dao.getMetadata(record
|
||||
.getDataURI());
|
||||
DatabaseQuery query = new DatabaseQuery(RedbookRecord.class);
|
||||
query.addQueryParam("wmoTTAAii", record.getWmoTTAAii());
|
||||
query.addQueryParam("corIndicator", record.getCorIndicator());
|
||||
query.addQueryParam("fcstHours", record.getFcstHours());
|
||||
query.addQueryParam("productId", record.getProductId());
|
||||
query.addQueryParam("fileId", record.getFileId());
|
||||
query.addQueryParam("originatorId", record.getOriginatorId());
|
||||
query.addQueryParam("dataTime", record.getDataTime());
|
||||
|
||||
PluginDataObject[] resultList = dao.getMetadata(query);
|
||||
|
||||
if (resultList != null && resultList.length > 0
|
||||
&& resultList[0] instanceof RedbookRecord) {
|
||||
existingRecord = (RedbookRecord) resultList[0];
|
||||
}
|
||||
} catch (PluginException e) {
|
||||
logger.error(traceId + "Could not create back-dated copy of "
|
||||
+ record.getDataURI(), e);
|
||||
|
|
Loading…
Add table
Reference in a new issue