1 Reply Latest reply on Feb 1, 2006 12:53 PM by wauwau0977

    EJB 3.0 Entity and MySql: Problem with Tinyblob and MediumBl

    wauwau0977

      hi

      i use jboss-4.0.3SP1 and have a problem with blobs in my mysql database.

      i create a table using a sql script which defines a "mediumblob" type. i use then an entity with the annotation @Lob (type=LobType.BLOB).

      when i deploy, the container changes my datatype from "mediumblob" to "tinyblob". why does this happen?

      in my persistence.xml where i defined my entitymanager i did *not* specify the "hibernate.hbm2ddl.auto" property. so why does it alter my table?

      any help is welcome! if it helps, i also post my code...

      regards,
      patrick heusser

      --
      patrick heusser
      abo_remove_everthing_but_first_abo@x8ing.com
      http://www.x8ing.com


        • 1. Re: EJB 3.0 Entity and MySql: Problem with Tinyblob and Medi
          wauwau0977

          hi

          in the meantime i figured out how to solve the problem. for everyone who is interested here my solution:

          there are two possible solutions. first hibernate deleted my tables, to avoid that include

          in the persistence.xml.

          an other way is to specifiy the table in the column entity annotation:
          @Column(name="image", columnDefinition="MEDIUMBLOB NOT NULL")
          i just tested the first solution, since the second is databse dependend.

          have a nice day..

          patrick heusser