Omaha #3720 Remove dataURI column references from redbook
Change-Id: I81ba779e6e9ded93256c7ccd7b2932ceefbfd51d Former-commit-id:1c83d2260f
[formerly8c9ecdd400
] [formerlyd03a4bd3e7
] [formerlyc034d98ab9
[formerlyd03a4bd3e7
[formerly 48160d952981b597634c941741e2bc370a5fdb5f]]] Former-commit-id:c034d98ab9
Former-commit-id: b875b4f60590be13a131d368f8cfbd927f8993c5 [formerly76a2964c73
] Former-commit-id:c4ea40b3f1
This commit is contained in:
parent
e069fb94b6
commit
902b4077f7
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