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