}
public void update(final PutMergePatchUriInfo putUriInfo, final InputStream content, final String requestContentType,
final String contentType) throws ODataJPARuntimeException, ODataJPAModelException {
UriInfo uriInfo = (UriInfo) putUriInfo;
EdmEntitySet targetEntitySet = uriInfo.getTargetEntitySet();
String targerEntitySetName;
EdmNavigationProperty navigationProperty = null;
try {
targerEntitySetName = targetEntitySet.getName();
} catch (EdmException e) {
throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e);
}
List<UriInfo> uriInfoList = new ArrayList<UriInfo>();
if (((UriInfo) uriInfo).isLinks()) {
UriInfo getUriInfo = parser.parseLink(targetEntitySet, content, requestContentType);
uriInfoList = new ArrayList<UriInfo>();
uriInfoList.add(getUriInfo);
navigationProperty = uriInfo.getNavigationSegments().get(0).getNavigationProperty();
} else {
uriInfoList = parser.parseLinks(targetEntitySet, content, contentType);
}
if (uriInfoList == null) {
return;
}
try {
for (UriInfo getUriInfo : uriInfoList) {
if (!getUriInfo.getTargetEntitySet().getName().equals(targerEntitySetName)) {
throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RELATIONSHIP_INVALID, null);
}
if (!((UriInfo) uriInfo).isLinks()) {
navigationProperty = getUriInfo.getNavigationSegments().get(0).getNavigationProperty();
}
targetJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
if (targetJPAEntity != null && ((UriInfo) uriInfo).isLinks()) {
getUriInfo = parser.parseLinkURI();
sourceJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
if (sourceJPAEntity == null) {
throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND
.addContent(getUriInfo.getTargetEntitySet().getName()), null);
}
}
JPAEntityParser entityParser = new JPAEntityParser();
Method setMethod =