当前位置: 技术问答>java相关
编译EJB时出现的问题
来源: 互联网 发布时间:2015-07-16
本文导语: 我用JBuilder7编写了一个CMP的实体Bean,可是在编译是提示我 "FirstBean.ejbgrpx": ERROR: Error from ejbc: [9.4.7.2] In EJB First, the primary key class java.lang.String has a field named CASE_INSENSITIVE_ORDER which is static. No field in the...
我用JBuilder7编写了一个CMP的实体Bean,可是在编译是提示我
"FirstBean.ejbgrpx": ERROR: Error from ejbc: [9.4.7.2] In EJB First, the primary key class java.lang.String has a field named CASE_INSENSITIVE_ORDER which is static. No field in the primary key class may be static.
这是怎么回事,我应该怎么解决?
"FirstBean.ejbgrpx": ERROR: Error from ejbc: [9.4.7.2] In EJB First, the primary key class java.lang.String has a field named CASE_INSENSITIVE_ORDER which is static. No field in the primary key class may be static.
这是怎么回事,我应该怎么解决?
|
你是不是把你的primary key(主键)设成了static啦,主键被每个BEAN实例拥有,所以不能设成STATIC的,改回来
|
是的,在EJB设计中要慎用static,很多的地方是不能使用static的。