Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] NullPointerException for ManyToOne ingeneric Embeddable

If I understand you correctly you want to do something like this:

Entity1 {
@ManyToOne
public Entity3<Integer> entity3;
}

Entity2 {
@ManyToOne
public Entity3<String> entity3;
}

Entity 3<X> {
   public X fooBar;
}

Is this correct? If so, no we currently don't support this type of configuration. Internally fooBar is represented as a single mapping with a static type. You may want to append this to the bug you entered previously to have someone at it.

In the mean time you could use inheritance and a mappedsuperclass to get around this, i.e.:

RootEntity {}

MappedSuperclass<X>  extends RootEntity {
   public X fooBar;
}

EntityInteger extends MappedSuperclass<Integer> {}

EntityString extends MappedSupeclass<String> {}

Entity1 {
@ManyToOne
public EntityInteger entityInteger;
}

Entity2 {
@ManyToOne
public EntityString entityString;
}

Cheers,
Guy

----- Original Message ----- From: "jml83" <jeffrey.m.leong@xxxxxxxxx>
To: <eclipselink-users@xxxxxxxxxxx>
Sent: Tuesday, July 21, 2009 11:29 AM
Subject: Re: [eclipselink-users] NullPointerException for ManyToOne ingeneric Embeddable



It seems this problem is not just for classes marked Embeddable. I removed
all embeddables and now I am getting this error for any parametrized
reference to an Entity. This would seem to imply this is broken for any
domain model with generics. This is surprising, and incredibly frustrating.

Is Eclipselink meant to work with Generics?
--
View this message in context: http://www.nabble.com/NullPointerException-for-ManyToOne-in-generic-Embeddable-tp24535000p24589987.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




Back to the top