[
https://issues.apache.org/jira/browse/OPENJPA-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028264#comment-13028264
]
Rick Curtis commented on OPENJPA-1978:
--------------------------------------
I'm still trying to figure out the NPE.... but have you tried to change the
targetEntity type to match the return type of the method?
@ManyToOne (cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity =
A.class)
public B getA() {
return this.a;
}
> Using a MappedSuperclass with IdClass causes NullPointerException in OpenJPA
> when having classes with persistent fields of the superclass type.
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-1978
> URL: https://issues.apache.org/jira/browse/OPENJPA-1978
> Project: OpenJPA
> Issue Type: Bug
> Affects Versions: 2.1.0
> Environment: independent, tested on Mac OS X (10.5/10.6) and Linux
> 2.6.32
> Reporter: Sascha Just
> Attachments: openjpa-nullpointerexception.tar.gz, stacktrace.txt
>
>
> We got a MappedSuperclass A with IdClass APK. The class B extends A using
> inheritance type 'TAPE_PER_CLASS'.
> The class C holds a field of type A. OpenJPA crashes with a
> NullPointerException in org.apache.openjpa.jdbc.meta.MappingInfo#mergeColumn.
> We tried different annotation strategies to tackle this problem but didn't
> find a way to get rid of the NullPointerException. While looking at the bug
> database we found a lot of issues that might be related to this problem but
> weren't able to track down the cause of the error.
> I will attach a stacktrace and a maven project containing a testcase for the
> above scenario reproducing the error.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira