Vladimir Mikhaylenko created OLINGO-1075:
--------------------------------------------
Summary: Internal server error when deleting links in JPA entities
with Sets
Key: OLINGO-1075
URL: https://issues.apache.org/jira/browse/OLINGO-1075
Project: Olingo
Issue Type: Bug
Components: odata2-jpa
Affects Versions: V2 2.0.8
Reporter: Vladimir Mikhaylenko
Hello,
I am developing simple application that exposes JPA model using JPA processor.
I found issue with deletion of links when JPA object exposed through Olingo has
sets as attributes.
My object has Set<OtherJPAObject> as attribute and related setter and getter
with Set in its signature.
When I execute DELETE on path
```/mapi.svc/Teams(1L)/$links/PersonDetails('i001001')```
I receive internal server error and message "attribute types mismatch".
I did some debugging and discovered that error happens when class JPALink
gathers related entries to be updated, it uses List and then passes List as the
parameter for invoke of setter to modify collection of the object.
Relevant stack trace is:
```
JPALink.delinkJPAEntities(Object, List<Object>, EdmNavigationProperty) line:
349
JPALink.delete(DeleteUriInfo) line: 143
JPAProcessorImpl.deleteLink(DeleteUriInfo) line: 398
JPAProcessorImpl.process(DeleteUriInfo, String) line: 252
ODataJPAFactoryImpl$ODataJPAAccessFactoryImpl$1(ODataJPADefaultProcessor).deleteEntityLink(DeleteUriInfo,
String) line: 241
Dispatcher.dispatch(ODataHttpMethod, UriInfoImpl, InputStream, String, String)
line: 165
ODataRequestHandler.handle(ODataRequest) line: 131
ODataSubLocator.handle(ODataHttpMethod) line: 164
ODataSubLocator.handleDelete() line: 78
```
When I change collection type to List, everything works like a charm, but List
is not so suitable for my domain model.
If you need, I can provide clear example of the issue.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)