forked from D-Net/dnet-hadoop
adding record identifier among the originalIds regardless of what IdentifierFactory produces
This commit is contained in:
parent
0977baf41d
commit
65934888a1
|
@ -202,12 +202,13 @@ public abstract class AbstractMdRecordToOafMapper {
|
|||
|
||||
final OafEntity entity = createEntity(doc, type, instances, collectedFrom, info, lastUpdateTimestamp);
|
||||
|
||||
final Set<String> originalId = Sets.newHashSet(entity.getOriginalId());
|
||||
originalId.add(entity.getId());
|
||||
entity.setOriginalId(Lists.newArrayList(originalId));
|
||||
|
||||
if (!forceOriginalId) {
|
||||
final String id = IdentifierFactory.createIdentifier(entity, shouldHashId);
|
||||
if (!id.equals(entity.getId())) {
|
||||
final Set<String> originalId = Sets.newHashSet(entity.getOriginalId());
|
||||
originalId.add(entity.getId());
|
||||
entity.setOriginalId(Lists.newArrayList(originalId));
|
||||
entity.setId(id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue