@Override public void applyTo(IBaseResource theResouce) { if (theResouce == null) { throw new NullPointerException("theResource can not be null"); } else if (theResouce instanceof IResource) { ((IResource) theResouce).setId(new IdDt(getValue())); } else if (theResouce instanceof IAnyResource) { ((IAnyResource) theResouce).setId(getValue()); } else { throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource"); } }
@Override public List<IBaseResource> toListOfResources() { ArrayList<IBaseResource> retVal = new ArrayList<IBaseResource>(); for (Entry next : myBundle.getEntry()) { if (next.getResource() != null) { retVal.add(next.getResource()); } else if (next.getResponse().getLocationElement().isEmpty() == false) { IdDt id = new IdDt(next.getResponse().getLocation()); String resourceType = id.getResourceType(); if (isNotBlank(resourceType)) { IResource res = (IResource) myContext.getResourceDefinition(resourceType).newInstance(); res.setId(id); retVal.add(res); } } } return retVal; }
next.getResource().setId(resourceId); } else { ourLog.info("Discarding resource with not explicit ID");
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam T theResource, @IdParam IdDt theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().update(theResource, theConditional, theRequestDetails); } else { theResource.setId(theId); return getDao().update(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
res.setId(nextResourceId); res.setId((String) null); DaoMethodOutcome outcome; outcome = resourceDao.create(res, nextReqEntry.getRequest().getIfNoneExist(), false, theUpdateTime, theRequestDetails); res.setId(new IdDt(parts.getResourceType(), parts.getResourceId())); outcome = resourceDao.update(res, null, false, theRequestDetails); } else { res.setId((String) null); outcome = resourceDao.update(res, parts.getResourceType() + '?' + parts.getParams(), false, theRequestDetails);
res.setId(theEntity.getIdDt().withVersion(theVersion.toString()));
@Override public void applyTo(IBaseResource theResouce) { if (theResouce == null) { throw new NullPointerException("theResource can not be null"); } else if (theResouce instanceof IResource) { ((IResource) theResouce).setId(new IdDt(getValue())); } else if (theResouce instanceof IAnyResource) { ((IAnyResource) theResouce).setId(getValue()); } else { throw new IllegalArgumentException("Unknown resource class type, does not implement IResource or extend Resource"); } }
@Override public List<IBaseResource> toListOfResources() { ArrayList<IBaseResource> retVal = new ArrayList<IBaseResource>(); for (Entry next : myBundle.getEntry()) { if (next.getResource() != null) { retVal.add(next.getResource()); } else if (next.getResponse().getLocationElement().isEmpty() == false) { IdDt id = new IdDt(next.getResponse().getLocation()); String resourceType = id.getResourceType(); if (isNotBlank(resourceType)) { IResource res = (IResource) myContext.getResourceDefinition(resourceType).newInstance(); res.setId(id); retVal.add(res); } } } return retVal; }
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam T theResource, @IdParam IdDt theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().update(theResource, theConditional, theRequestDetails); } else { theResource.setId(theId); return getDao().update(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
res.setId(nextResourceId); res.setId((String) null); DaoMethodOutcome outcome; outcome = resourceDao.create(res, nextReqEntry.getRequest().getIfNoneExist(), false, theUpdateTime, theRequestDetails); res.setId(new IdDt(parts.getResourceType(), parts.getResourceId())); outcome = resourceDao.update(res, null, false, theRequestDetails); } else { res.setId((String) null); outcome = resourceDao.update(res, parts.getResourceType() + '?' + parts.getParams(), false, theRequestDetails);
res.setId(theEntity.getIdDt().withVersion(theVersion.toString()));