“Found: bit, expected: boolean” after Hibernate 4 upgrade

I worked this out by adding columnDefinition = "BIT" to the @Column line.

@Basic
@Column(name = "B", columnDefinition = "BIT", length = 1)
public boolean isB() {
    return b;
}

Its defined as a ‘BIT(1)’ in the DB as well. Also worked with TINYINT. This is the easiest solution I’ve found since the change is super-minor and no need to touch the DB.

Using: MySQL Server 5.5.13, Hibernate 4.1.1, JDK 1.6

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)