users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Thu, 02 Sep 2010 20:04:28 PDT

Hi all,

I am trying to understand why when I have an entity bean reference in another entity bean, it shows up as a BLOB column and not a simple ID pointer (long?)? It makes it impossible to simply insert rows with SQL, and when I do have it running (GlassfishV3, Java6), it appears each row eats up a ton of space... it's as if it is serializing the entire referenced object into the column as a blob.

@Entity
public class User {
...
}


@Entity
public class Group {
  @OneToOne
  private User user;

...

}


Love to understand how to make it not work like this.

Thank you for any help.
[Message sent by forum member 'andjarnic']

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