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

org.hibernate.HibernateException: Wrong column type Found:

Fehler z.B;

org.hibernate.HibernateException: Wrong column type Found: tinyint, expected: smallint

Das bedeutet, dass Hibernate TINYINT als Spaltetyp in der Tabelle findet, aber in der Mapping-File(also in Java bzw. xml -Datei) ist es als short definiert. Gleiche kann man für Char und String sagen.

Standardmäßig konvertiert Hibernate java.lang.Short to smallint.

Lösung: 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: