Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] The Java type [null] is not a valid database type -- any clues?

I'm now encountering it in another @ManyToOne situation where the presence or absence of @JoinColumns doesn't seem to matter.  I'll definitely file a bug.

Best,
Laird

On Tue, Jun 30, 2009 at 12:35 PM, James Sutherland <jamesssss@xxxxxxxxx> wrote:

This error is odd, please log a detailed bug for it include the object
model/annotations and the error message.  The default mapping should be able
to determine the column type in most cases.


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
>
>


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/The-Java-type--null--is-not-a-valid-database-type----any-clues--tp24257687p24275234.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