Merge "Omaha #3720 Remove dataURI column references from redbook" into omaha_14.4.1
Former-commit-id:931ef160c9
[formerly325bf767a0
] [formerly13096c2eaa
] [formerly931ef160c9
[formerly325bf767a0
] [formerly13096c2eaa
] [formerly9fe7950e24
[formerly13096c2eaa
[formerly add132c7f2baf5b421590827559b99954133be76]]]] Former-commit-id:9fe7950e24
Former-commit-id:836d437b0b
[formerly473d2edd5d
] [formerly 1f7544beafbcf4b4b38cb4dc95f0b87d469c0273 [formerly751d88442c
]] Former-commit-id: 74b6af791d752dfb1c75063aa5ccf8a0ec18206d [formerly6b094ebc5a
] Former-commit-id:9b737d0de0
This commit is contained in:
commit
76118c2b6b
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