Display ORACLE NUMBER Hibernate type

I have a table in an ORACLE 10g database with a column " kzCode NUMBER(1)

".

If I try to map this against Hibernate annotations in JBOSS Server WebApp like this:

@Column(nullable=false)
private Integer kzCode;

      

An error appeared:

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

      

I have also tried

@Column(nullable=false) private BigInteger kzCode;

      

mistake:

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

      

I really don't know which type of Java to take.

0


source to share


2 answers


OK, it worked!



I had the wrong dialect property in the persistence.xml file. Everything is working fine now.

+1


source


@Column(nullable=false)
private Boolean kzCode;

      



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

0


source







All Articles