views:

2216

answers:

2

Hello, I have a table in a ORACLE 10g database with a column "kzCode NUMBER(1)". If I try to map this with Hibernate annotations in JBOSS Server WebApp like this:

@Column(nullable=false) private Integer kzCode;

I got an error:

org.hibernate.HibernateException: Wrong column type: kzCode, expected: integer

I also tried

@Column(nullable=false) private BigInteger kzCode;

error: org.hibernate.HibernateException: Wrong column type: kzCode, expected: numeric(19,2)

I don't really know, what Java type to take.

A: 
@Column(nullable=false)
private Boolean kzCode;

or if you really want it to be a number, change the Oracle type to NUMBER(36, 0) and use long or Long in your Java.

Paul Croarkin
+1  A: 

ok, got it!

I had a wrong dialect property in persistence.xml file. Now all works fine..