5 Replies Latest reply on May 17, 2007 2:13 PM by Luis Daniel Rangel Tovar

    Strange column wrong type

    Chester Chee Newbie

      Hi,

      One of the field in my original table schema is type BLOB on my database (MySQL 5.0.x) and I have changed it to MEDIUMBLOB so the fields can hold better binary attachment to it. After I update the schema and reload the database, and run my Seam application, I got the following errors:

      15:49:17,866 INFO [TableMetadata] columns: [created_at, asset_request, institution_id, asset_report, id]
      15:49:17,870 WARN [ServiceController] Problem starting service persistence.units:ear=FBIS.ear,jar=FBIS.jar,unitName=FBIS
      javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: asset_request, expected: blob
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
      


      I checked my persistent class which has proper annotation already:-

      @Lob
       @Basic(fetch = FetchType.LAZY)
       @Column(name = "asset_request", nullable = false)
       @NotNull
       public byte[] getAssetRequest() {
       return this.assetRequest;
       }
      
       public void setAssetRequest(byte[] assetRequest) {
       this.assetRequest = assetRequest;
       }
      
      


      What else did I miss? Any enlightenment is greatly appreciated.