[
https://issues.apache.org/jira/browse/OFBIZ-13163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18058889#comment-18058889
]
Jacques Le Roux commented on OFBIZ-13163:
-----------------------------------------
As the description was quite unconventional, so a bit hard to understand at 1st
glance (no patch at all), I tried to find a way.
I guess Dimitri extracted these elements from an own component.
For reproducing
bq. create Entity with field attribute not-null="true", for field that is not
"prim-key" or "relation" (sample "entitymodel_sample.xml" attached)
I 1st put entitymodel_sample.xml in plugins/example/entitydef, then added
bq. <entity-resource type="model" reader-name="main" loader="main"
location="entitydef/entitymodel_sample.xml"/>
in example/ofbiz-component.xml
>From there created the SampleDB using 'loadAll' task and then imported the 2
>SampleDB items using the webtools/control/EntityImport with BACKUP_SAMPLE.xml
>content.
I then simply followed
bq. invoke "parseEntityXmlFile" from
"org.apache.ofbiz.webtools.WebToolsServices" with "createDummyFks" set to "Y"
using webtools/control/runService
> SQL Exception in GenericEntity.checkFks for fields with not-null="true"
> -----------------------------------------------------------------------
>
> Key: OFBIZ-13163
> URL: https://issues.apache.org/jira/browse/OFBIZ-13163
> Project: OFBiz
> Issue Type: Bug
> Components: framework/entity
> Affects Versions: 18.12.16
> Reporter: Dimitri
> Assignee: Jacques Le Roux
> Priority: Major
> Attachments: BACKUP_SAMPLE.xml, entitymodel_sample.xml, sample.java,
> services.xml
>
>
> Entities with field attribute not-null="true", for fields that are not
> "prim-key" or "relation"
> Cause GenericEntity.checkFks to throw "SQL Exception while executing the
> following:INSERT" for the valid data.
> How to reproduce:
> create Entity with field attribute not-null="true", for field that is not
> "prim-key" or "relation"
> (sample "entitymodel_sample.xml" attached)
> invoke "parseEntityXmlFile" from "org.apache.ofbiz.webtools.WebToolsServices"
> with "createDummyFks" set to "Y"
> (sample code "sample.java", service settings "service.xml" and restore data
> "BACKUP_SAMPLE.xml" attached)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)