throws ODataJPARuntimeException, ODataJPAModelException {
try {
EdmEntitySet targetEntitySet = uriInfo.getTargetEntitySet();
String targerEntitySetName = targetEntitySet.getName();
EdmNavigationProperty navigationProperty = null;
UriInfo getUriInfo = null;
if (uriInfo.isLinks()) {
getUriInfo = parser.parseLink(targetEntitySet, content, requestContentType);
navigationProperty = uriInfo.getNavigationSegments().get(0).getNavigationProperty();
} else {
return;
}
if (!getUriInfo.getTargetEntitySet().getName().equals(targerEntitySetName))
{
throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RELATIONSHIP_INVALID, null);
}
targetJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
if (targetJPAEntity != null && sourceJPAEntity == null) {
int index = context.getODataContext().getPathInfo().getODataSegments().size() - 2;
getUriInfo = parser.parseURISegment(0, index);
sourceJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
if (sourceJPAEntity == null) {
throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND
.addContent(getUriInfo.getTargetEntitySet().getName()), null);
}
}
if (targetJPAEntity != null && sourceJPAEntity != null) {
List<Object> targetJPAEntities = new ArrayList<Object>();
targetJPAEntities.add(targetJPAEntity);