-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Wrong column type ... Found: varchar, expected: longvarchar
PostPosted: Thu Aug 04, 2011 6:02 am 
Newbie

Joined: Thu Aug 04, 2011 5:51 am
Posts: 1
Hi there,

during the migration of an application from MySQL to HSQLDB I am struggling with one data type mapping issue that I cannot seem to figure out a solution for. Effectively, during the creation of the SessionFactory Hibernate's schema validator complains about an inconsistent schema mapping:

Code:
org.hibernate.HibernateException: Wrong column type in <table> for column description. Found: varchar, expected: longvarchar
        at org.hibernate.mapping.Table.validateColumns(Table.java:283)
        at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1343)
        at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:378)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
        [...]

The problematic field is annotated as:

Code:
@Column(name = "description", nullable = true)
@Type(type="text")

This causes Hibernate to generate a longvarchar column, which HSQLDB apparently translates into a varchar(16M), which breaks the validation.

This happens with Hibernate 3.6.6 / HSDLDB 2.2.4 and the schema is generated using hibernate3-maven-plugin 2.2.

Any hints how to fix this issue are much appreciated. For now I will just disable validation, but it would still be interesting how to fix validation for HSQLDB.

Regards,
Thilo


Top
 Profile  
 
 Post subject: Re: Wrong column type ... Found: varchar, expected: longvarchar
PostPosted: Mon Aug 10, 2015 6:24 am 
Newbie

Joined: Mon Aug 10, 2015 6:20 am
Posts: 1
I know that this is an old thread but i'm facing the exact same problem.

I'm using hibernate 4.3.7.Final and HSQLDB 2.3.3.

Any solution so far?

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.