Hi everyone

I am having some problems with scaffolding and foreign key prefixes.
I'm using MG 3.2.700.341 with reactor as ORM.

If the primary key of a table is TableID then I use fkTableID for the
foreign key in an other table.

The scaffolding forms and pages are generated and working, the foreign
key is a select box in the edit form.
So far so good. If I want to to add or edit an entry then I get the
following error:

[Macromedia][SQLServer JDBC Driver][SQLServer]The INSERT statement
conflicted with the FOREIGN KEY constraint "FK_MenuPunkt_MenuGruppe".
The conflict occurred in database "ProdukteKatalog", table
"dbo.MenuGruppe", column 'MenuGruppeID'.

If I remove the relationship between the 2 tables on SQL Server, I can
see that the fk is always 0. If the foreign key and the primary key
have the same name, then inserting and editing works fine.

Is it possible to have different names for pk and fk or do they have
to be the same?

Thanks in advance for any hints

Thomas

Reactor.xml config:
<object name="MenuPunkt">
        <hasOne name="MenuGruppe">
                <relate from="fkMenuGruppeID" to="MenuGruppeID" />
        </hasOne>
</object>
<object name="MenuGruppe">
        <hasMany name="MenuPunkt">
                <relate from="MenuGruppeID" to="fkMenuGruppeID" />
        </hasMany>
</object>

ModelGlue.xml config:
<scaffold object="MenuPunkt">
        <results>
                <result do="template.main" />
        </results>
</scaffold>
<scaffold object="MenuGruppe">
        <results>
                <result do="template.main" />
        </results>
</scaffold>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to