简体   繁体   English

HibernateException:在Oracle DB中将列从数字更改为varchar2后,列类型错误

[英]HibernateException: Wrong column type after changing column from number to varchar2 in a Oracle DB

I've got a strange behaviour in Hibernate after changing a column from number to varchar2 in a Oracle Database. 在Oracle数据库中将列从number更改为varchar2之后,我在Hibernate中出现了奇怪的行为。

Caused by: org.hibernate.HibernateException: Wrong column type in XXX for column SESSION_TOKEN. Found: varchar2, expected: number(10,0)

In my corresponding domain object I changed the variable from Integer to String like this: 在我对应的域对象中,我将变量从Integer更改为String,如下所示:

@Column(name = "SESSION_TOKEN", nullable = true)
private String sessionToken;

I already have the following property in the persistence.xml 我在persistence.xml中已经具有以下属性

<property name="hibernate.hbm2ddl.auto" value="validate"/>            

So it seems to me, that there is something like a internal cache which still contains the old description of the table? 在我看来,是否有类似内部缓存的内容仍然包含表的旧说明? Any ideas?? 有任何想法吗?? My Environment: JBoss AS: 7.1.1 Oracle: 11.2 我的环境:JBoss AS:7.1.1 Oracle:11.2

Problem solved! 问题解决了! Very strange!! 很奇怪!! After reboot of my laptop the problem was gone! 重新启动我的笔记本电脑后,问题消失了! Thanx zombie! 谢谢僵尸!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM