Home > JPA - Hibernate > org.hibernate.HibernateException: Wrong column type Found

org.hibernate.HibernateException: Wrong column type Found

Exception :

org.hibernate.HibernateException:

Wrong column type Found: tinyint, expected: smallint

This means that the Hibernate find a TINYINT column type in the table, but in the mapping file (ie in java or xml file) it is defined as short. Same can be said for Char and String.

By default, Hibernate converted java.lang.Short to smallint.

Solution : columnDefinition = “TINYINT”

@Column(name = "prioritaet", columnDefinition = "TINYINT")
private Short prioritaet;

 

Advertisements
Categories: JPA - Hibernate Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: