在JPA2.0和数据库DB2中生成主键时出现问题

时间:2013-11-27 20:04:07

标签: java jpa db2 openjpa

public class A implements Serializable {

/** The strategic_ goal_ key. */
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "A_KEY")
private String A_KEY;
}

当我尝试保存此对象时,期望JPA生成主键,我得到以下错误。

  Caused by: org.apache.openjpa.lib.jdbc.
 ReportingSQLException:  "CGSP.OPENJPA_SEQUENCE_TABLE" 
is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.52.95 {prepstmnt 1791912654 
SELECT SEQUENCE_VALUE 
FROM CGSP.OPENJPA_SEQUENCE_TABLE 
WHERE ID = ? FOR READ ONLY WITH RS USE AND KEEP UPDATE LOCKS 
[params=(int) 0]} [code=-204, state=42704]

有关如何自动生成主键值的任何建议

0 个答案:

没有答案