@Test public void checkUpdateEntityPropagateSerializerException() throws SerializerException { assertThrows(ODataException.class, () -> { cut.updateEntity(request, response, uriInfo, ContentType.APPLICATION_JSON, ContentType.APPLICATION_JSON); }); }
@Override public void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, ODataLibraryException { try { final JPACUDRequestProcessor p = factory.createCUDRequestProcessor(uriInfo, responseFormat, requestContext, request.getAllHeaders()); p.updateEntity(request, response, requestFormat, responseFormat); } catch (ODataApplicationException | ODataLibraryException e) { throw e; } catch (ODataException e) { throw new ODataApplicationException(e.getLocalizedMessage(), HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), null, e); } catch (RollbackException e) { if (e.getCause() instanceof OptimisticLockException) { throw new ODataJPAProcessorException(e.getCause().getCause(), HttpStatusCode.PRECONDITION_FAILED); } throw new ODataJPAProcessorException(e, HttpStatusCode.INTERNAL_SERVER_ERROR); } }
JPAODataRequestProcessor implements PrimitiveValueProcessor, PrimitiveCollectionProcessor, ComplexProcessor, ComplexCollectionProcessor,
    CountEntityCollectionProcessor, EntityProcessor, MediaEntityProcessor, ActionPrimitiveProcessor,
    ActionVoidProcessor { @Override public void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, ODataLibraryException { try { final JPACUDRequestProcessor p = factory.createCUDRequestProcessor(uriInfo, responseFormat, requestContext, request.getAllHeaders()); p.updateEntity(request, response, requestFormat, responseFormat); } catch (ODataApplicationException | ODataLibraryException e) { throw e; } catch (ODataException e) { throw new ODataApplicationException(e.getLocalizedMessage(), HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), null, e); } catch (RollbackException e) { if (e.getCause() instanceof OptimisticLockException) { throw new ODataJPAProcessorException(e.getCause().getCause(), HttpStatusCode.PRECONDITION_FAILED); } throw new ODataJPAProcessorException(e, HttpStatusCode.INTERNAL_SERVER_ERROR); } } }
JPAODataRequestProcessor implements PrimitiveValueProcessor, PrimitiveCollectionProcessor, ComplexProcessor, ComplexCollectionProcessor,
    CountEntityCollectionProcessor, EntityProcessor, MediaEntityProcessor, ActionPrimitiveProcessor,
    ActionVoidProcessor { @Override public void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, ODataLibraryException { try { final JPACUDRequestProcessor p = factory.createCUDRequestProcessor(uriInfo, responseFormat, requestContext, request.getAllHeaders()); p.updateEntity(request, response, requestFormat, responseFormat); } catch (ODataApplicationException | ODataLibraryException e) { throw e; } catch (ODataException e) { throw new ODataApplicationException(e.getLocalizedMessage(), HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), null, e); } catch (RollbackException e) { if (e.getCause() instanceof OptimisticLockException) { throw new ODataJPAProcessorException(e.getCause().getCause(), HttpStatusCode.PRECONDITION_FAILED); } throw new ODataJPAProcessorException(e, HttpStatusCode.INTERNAL_SERVER_ERROR); } } JPAODataRequestProcessor(final JPAODataCRUDContextAccess sessionContext,
      final JPAODataRequestContextAccess requestContext); }
JPAODataRequestProcessor implements PrimitiveValueProcessor, PrimitiveCollectionProcessor, ComplexProcessor, ComplexCollectionProcessor,
    CountEntityCollectionProcessor, EntityProcessor, MediaEntityProcessor, ActionPrimitiveProcessor,
    ActionVoidProcessor { @Override public void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, ODataLibraryException { try { final JPACUDRequestProcessor p = factory.createCUDRequestProcessor(uriInfo, responseFormat, requestContext, request.getAllHeaders()); p.updateEntity(request, response, requestFormat, responseFormat); } catch (ODataApplicationException | ODataLibraryException e) { throw e; } catch (ODataException e) { throw new ODataApplicationException(e.getLocalizedMessage(), HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), null, e); } catch (RollbackException e) { if (e.getCause() instanceof OptimisticLockException) { throw new ODataJPAProcessorException(e.getCause().getCause(), HttpStatusCode.PRECONDITION_FAILED); } throw new ODataJPAProcessorException(e, HttpStatusCode.INTERNAL_SERVER_ERROR); } } JPAODataRequestProcessor(final JPAODataCRUDContextAccess sessionContext,
      final JPAODataRequestContextAccess requestContext); @Override void init(final OData odata, final ServiceMetadata serviceMetadata); @Override void countEntityCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void createEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void createMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void deleteComplex(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deleteEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deletePrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deletePrimitiveValue(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deleteMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void readComplex(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
      ContentType responseFormat); @Override void readEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readEntityCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
      ContentType responseFormat); @Override void readPrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readPrimitiveValue(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void updateComplex(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updatePrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updatePrimitiveValue(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updateMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updatePrimitiveCollection(final ODataRequest request, final ODataResponse response,
      final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat); @Override void deletePrimitiveCollection(final ODataRequest request, final ODataResponse response,
      final UriInfo uriInfo); @Override void updateComplexCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void deleteComplexCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void processActionPrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void processActionVoid(ODataRequest request, ODataResponse response, UriInfo uriInfo,
      ContentType requestFormat); }
JPAODataRequestProcessor implements PrimitiveValueProcessor, PrimitiveCollectionProcessor, ComplexProcessor, ComplexCollectionProcessor,
    CountEntityCollectionProcessor, EntityProcessor, MediaEntityProcessor, ActionPrimitiveProcessor,
    ActionVoidProcessor { @Override public void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, ODataLibraryException { try { final JPACUDRequestProcessor p = factory.createCUDRequestProcessor(uriInfo, responseFormat, requestContext, request.getAllHeaders()); p.updateEntity(request, response, requestFormat, responseFormat); } catch (ODataApplicationException | ODataLibraryException e) { throw e; } catch (ODataException e) { throw new ODataApplicationException(e.getLocalizedMessage(), HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), null, e); } catch (RollbackException e) { if (e.getCause() instanceof OptimisticLockException) { throw new ODataJPAProcessorException(e.getCause().getCause(), HttpStatusCode.PRECONDITION_FAILED); } throw new ODataJPAProcessorException(e, HttpStatusCode.INTERNAL_SERVER_ERROR); } } JPAODataRequestProcessor(final JPAODataCRUDContextAccess sessionContext,
      final JPAODataRequestContextAccess requestContext); @Override void init(final OData odata, final ServiceMetadata serviceMetadata); @Override void countEntityCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void createEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void createMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void deleteComplex(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deleteEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deletePrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deletePrimitiveValue(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void deleteMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void readComplex(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
      ContentType responseFormat); @Override void readEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readEntityCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
      ContentType responseFormat); @Override void readPrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readPrimitiveValue(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void readMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType responseFormat); @Override void updateComplex(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updateEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updatePrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updatePrimitiveValue(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updateMediaEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void updatePrimitiveCollection(final ODataRequest request, final ODataResponse response,
      final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat); @Override void deletePrimitiveCollection(final ODataRequest request, final ODataResponse response,
      final UriInfo uriInfo); @Override void updateComplexCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void deleteComplexCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo); @Override void processActionPrimitive(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
      final ContentType requestFormat, final ContentType responseFormat); @Override void processActionVoid(ODataRequest request, ODataResponse response, UriInfo uriInfo,
      ContentType requestFormat);  }