I got the following error:
Caused by: org.hibernate.HibernateException: Wrong column type in TestTable for column PAYLOAD. Found: blob, expected: tinyblob at org.hibernate.mapping.Table.validateColumns(Table.java:284) at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1174) at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:387) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:883) ... 60 more
Hibernate column complains that it is declared as
private byte[] messagePayload; @Column(name="PAYLOAD") public byte[] getMessagePayload() { return messagePayload; } public void setMessagePayload(byte[] messagePayload) { this.messagePayload = messagePayload; }
A table in a MySQL table is declared as a BLOB type. Why doesn't Hibernate want to map it, and why does he insist that I use TINYBLOB?
thanks
ziggy source share