ljnelson wrote:
>
> On Mon, Jun 29, 2009 at 2:03 PM, Laird Nelson <
ljnelson@xxxxxxxxx> wrote:
>
>> On Mon, Jun 29, 2009 at 12:44 PM, Laird Nelson <
ljnelson@xxxxxxxxx>
>> wrote:
>>
>>> I've gotten this error while marking up some Entities and running them
>>> through unit tests. Both Hibernate and OpenJPA deal with my setup just
>>> fine, but it looks like at EntityManagerFactory creation time,
>>> EclipseLink
>>> barfs with this error. I've reproduced the stack below.
>>
>>
>> Through some blind trial and error, I found where this bug is.
>>
>> I have one entity, call it B, that has an @EmbeddedId field that consists
>> of four columns.
>>
>> I have another entity, call it A, that has a @ManyToOne relationship with
>> B. The field in question is annotated like this:
>>
>> @ManyToOne
>> private B b;
>>
>
> And that is the problem. I have not specified the full regiment of
> @JoinColumns.
>
> So, to recap: "Java type [null] is not a valid database type" actually
> means
> "You forgot to specify @JoinColumns on your @ManyToOne relationship."
>
> Interestingly, neither Hibernate nor OpenJPA seem to mind--who's correct
> here?
>
> Best,
> Laird
>
>