简体   繁体   English

如何在Apache Ofbiz中生成自动主键?

[英]How to generate Automatic Primary Key in Apache Ofbiz?

如何在表单中生成自动的唯一序列(用于主键),即当用户填写表单时,Apache Ofbiz中会生成一个自动的表单ID(将是该表单的主键)?

Ofbiz maintains sequence of a table in Sequence_Value_Item Table. Ofbiz维护Sequence_Value_Item表中表的顺序。 Every sequence of a table is starts with 10000. You can get the Sequence Number using Delegator. 表的每个序列都以10000开头。您可以使用Delegator获取序列号。

   delegator.getNextSeqId("YourTableName");

Set this sequence with Generic Value to Create new Record. 将此序列与“通用值”一起设置以创建新记录。

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

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