if (isBlank(forcedId.getResourceType())) { ourLog.info("Updating resource {} forcedId type to {}", forcedId.getForcedId(), resourceTable.getResourceType()); forcedId.setResourceType(resourceTable.getResourceType()); myForcedIdDao.save(forcedId);
/** * Returns the newly created forced ID. If the entity already had a forced ID, or if * none was created, returns null. */ protected ForcedId createForcedIdIfNeeded(ResourceTable theEntity, IIdType theId, boolean theCreateForPureNumericIds) { if (theId.isEmpty() == false && theId.hasIdPart() && theEntity.getForcedId() == null) { if (!theCreateForPureNumericIds && IdHelperService.isValidPid(theId)) { return null; } ForcedId fid = new ForcedId(); fid.setResourceType(theEntity.getResourceType()); fid.setForcedId(theId.getIdPart()); fid.setResource(theEntity); theEntity.setForcedId(fid); return fid; } return null; }
if (isBlank(forcedId.getResourceType())) { ourLog.info("Updating resource {} forcedId type to {}", forcedId.getForcedId(), resourceTable.getResourceType()); forcedId.setResourceType(resourceTable.getResourceType()); myForcedIdDao.save(forcedId);
/** * Returns the newly created forced ID. If the entity already had a forced ID, or if * none was created, returns null. */ protected ForcedId createForcedIdIfNeeded(ResourceTable theEntity, IIdType theId, boolean theCreateForPureNumericIds) { if (theId.isEmpty() == false && theId.hasIdPart() && theEntity.getForcedId() == null) { if (!theCreateForPureNumericIds && IdHelperService.isValidPid(theId)) { return null; } ForcedId fid = new ForcedId(); fid.setResourceType(theEntity.getResourceType()); fid.setForcedId(theId.getIdPart()); fid.setResource(theEntity); theEntity.setForcedId(fid); return fid; } return null; }