Hi Andrew,

thanks for your fast reply.

On Thu, Jul 06, 2006 at 11:41:01AM +0100, Andrew Sykes wrote:
> Just a guess, could it be that you already have tables with another name
> using this same foreign key id?

Well, I've checked this, but even after defining self-chosen PKs the
problem still resists. The errors remain the same.

---- Changed entitymodel.xml: ----
<?xml version="1.0" encoding="UTF-8"?>
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd";>
        <title>srm</title>
        <version>1.0</version>
        <entity entity-name="SrmUserTypes" package-name="org.ofbiz"
                title="Example for some kinds of users">
                <field name="srmUserTypeId" type="id-ne" />
                <field name="srmUserTypeName" type="short-varchar" />
                <field name="srmUserTypeDesc" type="long-varchar" />
                <prim-key field="srmUserTypeId" />
        </entity>
        <entity entity-name="SrmUserLogins" package-name="org.ofbiz"
                title="Example for logins an passwords">
                <field name="srmUserLogin" type="short-varchar" />
                <field name="srmUserTypeId" type="id-ne" />
                <field name="srmUserPassword" type="short-varchar" />
                <prim-key field="srmUserLogin" />
                <relation rel-entity-name="SrmUserTypes" type="one" 
fk-name="srm_fk_01">
                        <key-map field-name="srmUserTypeId" />
                </relation>
        </entity>
        <entity entity-name="SrmUserDetails" package-name="org.ofbiz"
                title="Some details, multiple times per user">
                <field name="srmUserLogin" type="short-varchar" />
                <field name="srmUserDetailId" type="id-ne" />
                <field name="srmUserTypeId" type="id-ne" />
                <field name="srmUserFirstName" type="short-varchar" />
                <field name="srmUserLastName" type="short-varchar" />
                <field name="srmUserPhone" type="short-varchar" />
                <prim-key field="srmUserId" />
                <prim-key field="srmUserDetailId" />
                <relation type="one" rel-entity-name="SrmUserLogins" 
fk-name="srm_fk_02"> 
                        <key-map field-name="srmUserLogin" />
                </relation>
                <relation rel-entity-name="SrmUserTypes" type="one" 
fk-name="srm_fk_03">
                        <key-map field-name="srmUserTypeId" />
                </relation>
        </entity>
</entitymodel>
-------------

Did i oversee anything? I would copy the logs again, but their content
is the same, so I think this is unnecessary. Could you perhaps imagine
anything else?

In my last mail I forgot to mention that it's no problem to work with
these two entities by using Webtools. The entered values are also stored
in the database. I don't know whether I should open a bug report in JIRA
or if there is anything I did wrong.

> lso, it looks as if much of what you are doing is already in the
> default entities, are you sure you need to create these?

These entities were just created for "playing" with OFBiz. I want to
learn how to work with it and I want to know how to handle errors. The
error is already there, just the second part is missing. ;-)

Best regards,
Fabian.

Reply via email to