• Post Reply Bookmark Topic Watch Topic
  • New Topic

mysql LongText mapping in Hibernate  RSS feed

Hagar Nishaachar
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a database field in a mysql db report_data which can contain a large amount of text data. I had been using the 'text' column datatype untill I ran into the limit recently. I've tried changing the column datatype to 'LongText' in the DB and updated the mapping file to ;
<property name="reportData" type="text" length="2147483647">
<column name="report_data"/>

But I keep getting this error;
Caused by: org.hibernate.HibernateException: Wrong column type: report_data, expected: text
at org.hibernate.mapping.Table.validateColumns(Table.java:261)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1083)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:317)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.yahoo.ysm.tivt.util.HibernateUtil.<clinit>(HibernateUtil.java:37)

I'm using the following versions
c3p0 -
hibernate - 3.2.5.ga
mysql-connector-java - 5.0.7

Can someone tell me what I'm missing? My research on the web lead me to this link http://www.hibernate.org/112.html which is what i've followed.
Thanks in advance!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!