users@glassfish.java.net

Re: Entity reference to another entity creates BLOB column in mysql table..why?

From: <glassfish_at_javadesktop.org>
Date: Sun, 12 Sep 2010 23:04:38 PDT

Figured out the problem. Actually two issues.

First thing is that I didn't add the right annotation to one of the entities. I had the @OneToMany, but the @ManyToOne I didn't do right.. or vice versa.

The main issue tho, which on other entities I have that also had the blob column issue, was that I had @Basic(optional=false) above several properties. I don't know why/how this converts a bigint(20) into a blob column, but it does. At least with GlassFish v3 and MySql 5. Soon as I removed that annotation from a few different entities that were all exhibiting this issue, they all now show bigint(20) and all looks normal now.

Thank you for the replies. Wish my book and/or other searches would have revealed this.
[Message sent by forum member 'andjarnic']

http://forums.java.net/jive/thread.jspa?messageID=482482