users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Tue, 07 Sep 2010 19:46:18 PDT

Hi,

I believe I have it set up correctly. My example may have been wrong, but checking my actual code, I have the annotations on the correct objects. For the heck of it I reversed it, the desc in mysql still shows BLOB columns, and I have DDL set to drop-and-create on deploy, so it recreates all the tables each time.

This just seems very strange to me that referenced/foreign keys show up as BLOB columns and store full object data in them instead of simple 64-bit long pointers to an index in another table. I mean, I could do this the old JDBC way.. that is, instead of a reference to User in the Group entity, I simply use a long userId and in the query just use that instead of the object name... although not sure if the named queries on entities will work with that or not.

Is there any reason you can think of that the object ref would be stored in a Blob column type instead of long/integer values that refer to the ID value of the other table it refers to?

I haven't been able to find anything in the properties list for EclipseLink that describes this issue, nor after several google searched I can't seem to find anyone else with this issue.
[Message sent by forum member 'andjarnic']

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