Table.validateColumns fails on valid column

Description

This may be an Annotations bug (3.1beta8), bug the exception happens in Core.

This column used to pass when I used this:

@Column(columnDefinition = "INT UNSIGNED NOT NULL DEFAULT 0", nullable = false)

I have since changed it to

@Column(columnDefinition = "INT UNSIGNED DEFAULT 0", nullable = false)

because "nullable = false" adds the "not null".

I am guessing that the nullable isn't being used in the validateColumns. I have not yet investigated, but the stack trace is below.

org.hibernate.tool.hbm2ddl.TableMetadata.<init> table found: xxx.yyy
org.hibernate.tool.hbm2ddl.TableMetadata.<init> columns: [foo_id, ipaddress, actiontype, timestamp, id]
com.caucho.server.webapp.Application.start org.hibernate.HibernateException: Wrong column type: ipAddress, expected: INT UNSIGNED DEFAULT 0
at org.hibernate.mapping.Table.validateColumns(Table.java:219)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:964)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:296)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1164)
[...]

Activity

Show:

Steve Ebersole March 21, 2011 at 7:04 PM

Bulk closing stale resolved issues

Diego Plentz August 16, 2007 at 3:27 AM

Closing as "fixed" since the main problem is solved and the "comment problem" is fixed by HHH-2315.

Max Rydahl Andersen August 15, 2007 at 8:02 PM

yes - just telling what the general issue is generally the validatecolumn method is waay to naive.

Diego Plentz August 15, 2007 at 6:15 PM

Max, the first part of the problem I already solved.

Max Rydahl Andersen August 15, 2007 at 5:33 PM

this is a well known issue with schemavalidator - it does not handle compatible types, but with different string names correctly.

search for validator issues and you will see ,)

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 26, 2006 at 1:45 AM
Updated March 21, 2011 at 7:04 PM
Resolved August 16, 2007 at 3:27 AM