Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA meta-model getJavaMember does not work with dynamic JPA
JPA meta-model getJavaMember does not work with dynamic JPA [message #995838] Mon, 31 December 2012 03:46 Go to next message
Arieh Faiga is currently offline Arieh Faiga
Messages: 3
Registered: December 2012
Junior Member
Attribute.getJavaMember has an explicit cast to InstanceVariableAttributeAccessor.
However Dynamic Enties have a ValuesAccessor.
Therefore this causes an InvalidCastException when called with a Dynamic Entity.
ie Currently JPA meta-model getJavaMember does not work with dynamic JPA.

This issue is mentioned at:
http://www.eclipse.org/forums/index.php/t/250415/

Problematic line of code:
Member aMember = ((InstanceVariableAttributeAccessor) accessor).getAttributeField();


Exception:
Exception in thread "main" java.lang.ClassCastException: org.eclipse.persistence.internal.dynamic.ValuesAccessor cannot be cast to org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor
at org.eclipse.persistence.internal.jpa.metamodel.AttributeImpl.getJavaMember(AttributeImpl.java:139)
at org.odata4j.producer.jpa.JPAEdmGenerator.toEdmProperty(JPAEdmGenerator.java:107)
at org.odata4j.producer.jpa.JPAEdmGenerator.getProperties(JPAEdmGenerator.java:130)
at org.odata4j.producer.jpa.JPAEdmGenerator.buildEdm(JPAEdmGenerator.java:182)
at org.odata4j.producer.jpa.JPAProducer.<init>(JPAProducer.java:85)
at edu.vt.ipg.odatahandsdynamic.App.main(App.java:59)


To see the body of the Attribute.getJavaMember:
Attribute.getJavaMember
Re: JPA meta-model getJavaMember does not work with dynamic JPA [message #996166 is a reply to message #995838] Tue, 01 January 2013 02:46 Go to previous message
Arieh Faiga is currently offline Arieh Faiga
Messages: 3
Registered: December 2012
Junior Member
Opened defect
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397283
Previous Topic:Dynamic JPA problem - empty Metamodel
Next Topic:Trouble retrieving Oracle TIMESTAMPTZ type
Goto Forum:
  


Current Time: Thu Apr 17 08:30:20 EDT 2014

Powered by FUDForum. Page generated in 0.01884 seconds