[
https://issues.apache.org/jira/browse/OLINGO-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15591101#comment-15591101
]
Oliver Grande commented on OLINGO-1010:
---------------------------------------
Hello Alexandre,
I switch to Hibernate and It turned out that Hibernate somehow treats the JPA
metadata differently than EclipseLink. At least in case of compound keys has we
have it at BusinessPartnerRole. Hibernate look at the key class
BusinessPartnerRoleKey, whereas EclipseLink looks at the entity class
BusinessPartnerRole. As a consequence Hibernate would expect the @Column
annotation at BusinessPartnerRoleKey:
@Id
@Column(name = "\"BusinessPartnerID\"")
private String businessPartnerID;
@Id
@Column(name = "\"BusinessPartnerRole\"")
private String roleCategory;
Unfortunately it turned out that this is not the complete story. I try to get
the default values given at an attribute. To do so an instance of the class is
created. With Hibernate a mismatch occurs and requires a correction. In class
org.apache.olingo.jpa.metadata.core.edm.mapper.impl.IntermediateProperty in
method getDeafultValue line "final Constructor<?> constructor =
jpaAttribute.getDeclaringType().getJavaType().getConstructor()"; has to be
replaced with "final Constructor<?> constructor =
field.getDeclaringClass().getConstructor();"
I had an additional problem with "parent" association at
AdministrativeDivision. Just deleting the @JoinColumns annotation solved it.
> OData V4 JPA Processor
> ----------------------
>
> Key: OLINGO-1010
> URL: https://issues.apache.org/jira/browse/OLINGO-1010
> Project: Olingo
> Issue Type: New Feature
> Components: odata4-server
> Affects Versions: (Java) V4 4.0.0, (Java) V4 4.2.0, (Java) V4 4.3.0
> Reporter: Oliver Grande
> Attachments: OlingoV4JPA-apache.zip,
> odata-jpa-annotation-0.0.1-SNAPSHOT.jar,
> odata-jpa-metadata-0.0.1-SNAPSHOT.jar, odata-jpa-processor-0.0.1-SNAPSHOT.jar
>
>
> Hello,
> I have created a first version of a JPA Processor for Olingo V4. The
> Processor is, as of now able to generate metadata document and perform GET
> requests. I like to contribute with this to Olingo.
> Regards,
> Oliver
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)