dev@glassfish.java.net

ejb 2.1 and table with no primary key supported?

From: Cheng Fang <Cheng.Fang_at_Sun.COM>
Date: Tue, 25 Jul 2006 10:56:04 -0400

This user is using ejb 2.1 on SJSAS PE 9. The Student table doesn't
designate a primary key, but in ejb code he uses 'id' as if it was a
primary key. The app failed to deploy on SJSAS 9. But he was able to
deploy and run the same app on JBoss.

error messages (hope you can tell something from a few keywords)
Deploying application in domain failed; 运行 EJBC 时发生错误 -- 来自 EJB
编译器的致命错误 -- JDO74025: JDOCodeGenerator: 验证应用程序“EJBModule1”
的模块“EJBModule1”中的 CMP Bean“Fhdsckfhz”时捕获异常: JDO72335: 如果与生
成的类 testsss.FhdsckfhzBean96247497_JDOState 对应的 Bean 的表 fhdsckfhz
被映射为主表, 则它必须有主键。请选择其它主表或验证模式文件的内容是否正确。

Once he specified 'id' as primary key in database table, it deploys and
runs fine. So the question is, does SJSAS 9 ejb 2.x support tables with
no primary key?

More details are here:
http://gceclub.sun.com.cn/NASApp/sme/jive/thread.jsp?forum=22&thread=39131

-- 
Cheng