Skip to main content
Participant
November 30, 2011
Question

cf9 - flex - orm updating entity with a relation

  • November 30, 2011
  • 1 reply
  • 740 views

Hello,

I'm trying to update a cf9 orm entity with a one-to-many relation defined as follow:

Articles

property name="ArticleID" column="ArticleID" type="numeric" ormtype="int" fieldtype="id" default="0" generator="identity" unsavedvalue="0";
property name="ModelName" column="ModelName" type="string" ormtype="string" ;
property name="Description" column="Descrption" type="string" ormtype="string" ;
property name="ArticleImages" type="array" fieldtype="one-to-many" cfc="Images" fkcolumn="ArticleID" fetch="join" remotingfetch="true" cascade="all-delete-orphan";                       

Images

property name="ArticleImageID" column="ArticleImageID" type="numeric" ormtype="int" fieldtype="id" generator="identity" default="0" unsavedvalue="0";
property name="ArticleID" column="ArticleID" type="numeric" ormtype="int"; 
property name="FilePath" column="FilePath" type="string" ormtype="string";

Everything works fine if I update (entitysave) Articles by a coldFusion page.

If I try by a Flex app using remoteObject all records are written with right values but I receive a fault event with a message which say the ArticleID of the table Images can't contain a Null value.

In fact in the database the ArticleID field is right updated but I don't know why I receive always the same error.

The remote object mapping seems to be right established.

I'm testing with a SQL2008R2 database and all the tables have an IDENTITY primary key field.

Does anybody have experienced this situation ?

How can I solve this problem ?

Thanks,

Daive

This topic has been closed for replies.

1 reply

Inspiring
December 5, 2011

Did you have tried "entitymerge" instead of "entitysave" ?