0

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.

2 Answers 2

1

ok, got it!

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

Sign up to request clarification or add additional context in comments.

Comments

0
@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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.