尝试在OfBiz中保存任务时收到FK违规错误

时间:2017-02-10 18:49:24

标签: java sql apache ofbiz

在OfBiz 16.11.01中创建任务时遇到问题。标准构建,进行一些基本测试,当我尝试在项目中创建任务时,我收到与FK约束违规相关的以下错误:

(插入时出错:[GenericEntity:WorkEffort] [createdByUserLogin,admin(java.lang.String)] [createdDate,2017-02-10 12:12:23.823(java.sql.Timestamp)] [createdStamp,2017 -02-10 12:12:23.823(java.sql.Timestamp)] [createdTxStamp,2017-02-10 12:12:23.075(java.sql.Timestamp)] [currentStatusId,PTS_CREATED(java.lang.String)] [描述,与利益相关者初步会面以定义范围等(java.lang.String)] [estimatedCompletionDate,2017-02-10 00:00:00.0(java.sql.Timestamp)] [estimatedStartDate,2017-02-10 00:00:00.0(java.sql.Timestamp)] [lastModifiedByUserLogin,admin(java.lang.String)] [lastModifiedDate,2017-02-10 12:12:23.823(java.sql.Timestamp)] [lastStatusUpdate,2017 -02-10 12:12:23.823(java.sql.Timestamp)] [lastUpdatedStamp,2017-02-10 12:12:23.823(java.sql.Timestamp)] [lastUpdatedTxStamp,2017-02-10 12:12: 23.075(java.sql.Timestamp中)] [优先级,1(java.lang.Long中)] [revisionNumber,1(java.lang.Long中)] [scopeEnumId,WES_PRIVATE(java.lang.String中)] [sequenceNum,1( java.lang.Long中)] [workEffortId,10076(java.lang中。 String)] [workEffortName,Meet(java.lang.String)] [workEffortParentId,10060(java.lang.String)] [workEffortTypeId,Task(java.lang.String)]

(执行以下操作时出现SQL异常:

INSERT INTO OFBIZ.WORK_EFFORT(WORK_EFFORT_ID,WORK_EFFORT_TYPE_ID,CURRENT_STATUS_ID,LAST_STATUS_UPDATE,WORK_EFFORT_PURPOSE_TYPE_ID,WORK_EFFORT_PARENT_ID,SCOPE_ENUM_ID,优先级,PERCENT_COMPLETE,WORK_EFFORT_NAME,SHOW_AS_ENUM_ID,SEND_NOTIFICATION_EMAIL,说明,LOCATION_DESC,ESTIMATED_START_DATE,ESTIMATED_COMPLETION_DATE,ACTUAL_START_DATE,ACTUAL_COMPLETION_DATE,ESTIMATED_MILLI_SECONDS,ESTIMATED_SETUP_MILLIS,ESTIMATE_CALC_METHOD ,ACTUAL_MILLI_SECONDS,ACTUAL_SETUP_MILLIS,TOTAL_MILLI_SECONDS_ALLOWED,TOTAL_MONEY_ALLOWED,MONEY_UOM_ID,SPECIAL_TERMS,TIME_TRANSPARENCY,UNIVERSAL_ID,SOURCE_REFERENCE_ID,FIXED_ASSET_ID,FACILITY_ID,INFO_URL,RECURRENCE_INFO_ID,TEMP_EXPR_ID,RUNTIME_DATA_ID,NOTE_ID,SERVICE_LOADER_NAME,QUANTITY_TO_PRODUCE,QUANTITY_PRODUCED,QUANTITY_REJECTED,RESERV_PERSONS,RESERV2ND_P_P_PERC,RESERV_NTH_P_P_PERC,ACCOMMODATION_MAP_ID,ACCOMMODATION_SPOT_ID ,REVISION_NUMBER,CREATED_DATE,CREATED_BY_USER_LOGIN,LAST_MODIFIED_DATE,LAST_MODIFIED _BY_USER_LOGIN,LAST_UPDATED_STAMP,LAST_UPDATED_TX_STAMP,CREATED_STAMP,CREATED_TX_STAMP,SEQUENCE_NUM)值(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?,?,?,?)

(表'WORK_EFFORT'上的INSERT导致违反外键约束'WK_EFFRT_TYPE'的键(任务)。该语句已被回滚。)))

Screenshot

该语句似乎是将'Task'作为WorkEffortType表中列出的workEffortTypeId提交。有什么想法吗?

1 个答案:

答案 0 :(得分:1)

可能是WORK_EFFORT_TYPE_ID为空。您可以加载演示数据以进行测试