[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Parsing exception description...can't do it
|
On Thu, Feb 10, 2011 at 4:06 PM, Laird Nelson
<ljnelson@xxxxxxxxx> wrote:
The exception description I'm getting is:
Exception Description: The reference column name [code] mapped on the element [field donationTypeCode] does not correspond to a valid field on the mapping reference.
Is this because of a bad @ManyToOne annotation somewhere?
I think I found the only place this could be, but...there hasn't been a problem here in earlier versions of EclipseLink. I'm using the latest version of Glassfish embedded, which seems to use a snapshot of EclipseLink 2.2.0.
Here's what I've got. In all cases I am not the class author.
A @MappedSuperclass named AbstractType, which, among other things, has this defined:
@Basic(optional = false)
@Column(name = "code", length = 8, unique = true, nullable = false)
private String code;
Then I have a class that inherits from this @MappedSuperclass and which defines no additional fields. Its name is DonationTypeEntity.
Finally, I have the offender--an entity named AcknowledgeTypeEntity with a @ManyToOne in it like this:
@ManyToOne(optional = false, targetEntity = DonationTypeEntity.class)
@JoinColumn(name = "donation_type_code", referencedColumnName = "code", nullable = false)
private DonationType donationTypeCode;
It would appear that EclipseLink is complaining about this perfectly valid mapping. Or have I been doing something wrong here for months, and it's only now that EclipseLink (and no other JPA provider) has found it?
Thanks,
Laird