[
https://issues.apache.org/jira/browse/OLINGO-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838607#comment-13838607
]
Chandan V.A commented on OLINGO-74:
-----------------------------------
OData JPA processor library now supports the interface type java.util.Set along
with java.util.List. The library has been enhanced to work with a more generic
interface type namely java.util.Collection. With this approach all sub
interfaces like java.util.Set and java.util.List are supported implicitly.
However support for java.util.Map is still open.
Secondly it is expected that the JPA Entity provides a non null reference to
the implementation of interface types java.util.Set and java.util.List when the
"get" method for the property is invoked.
Example:- Here the method getSalesOrderItem is expected to provide a non-null
reference.
@Entity
@Table(name = "T_SALESORDERHEADER")
public class SalesOrder {
....
@OneToMany(mappedBy = "salesOrderHeader", cascade = CascadeType.ALL)
private Set<SalesOrderItem> salesOrderItem = new HashSet<SalesOrderItem>();
public Set<SalesOrderItem> getSalesOrderItem() {
return salesOrderItem;
....
}
}
This is required for the OData JPA Processor Library to work with the correct
implementation types for these interfaces. In case a null reference is returned
the OData JPA processor library resorts to java.util.ArrayList.
We could also discuss in case the solution has gaps.
> Support for JPA properties with java.util.Set Data Types - For Deep Insert
> ---------------------------------------------------------------------------
>
> Key: OLINGO-74
> URL: https://issues.apache.org/jira/browse/OLINGO-74
> Project: Olingo
> Issue Type: Sub-task
> Components: odata2-jpa
> Affects Versions: V2 1.1.0
> Reporter: Chandan V.A
> Assignee: Chandan V.A
> Priority: Critical
> Fix For: V2 1.1.0
>
>
> JPA Processor library cannot handle the property during deep insert provided
> the JPA Entity defines a Relationship property as java.util.Set.
> Support java.util.Set data types for relationships.
--
This message was sent by Atlassian JIRA
(v6.1#6144)