ORM EntitySave() - 在调用save()之前必须手动分配此类的ID

Jas*_*son 8 coldfusion coldfusion-9

当试图做EntitySave("publications",arguments);...我收到以下错误.

ids for this class must be manually assigned before calling save(): publications
Run Code Online (Sandbox Code Playgroud)

我无法理解为什么..我的数据库主键设置正确,我在我的CFC中有setter = false这些属性.我在谷歌搜索时发现了这个错误,但似乎没有任何迹象表明这是导致我的问题的原因.

这是我的CFC.关于我可能做错的任何指示都表示赞赏.谢谢你提前!

Publications.cfc

component persistent="true" table="publications"  
hint="Publications"{
    property name="id" fieldtype="id" setter="false";
    property name="typeid" omrtype="int";
    property name="name" ormtype="string";
    property name="dateScheduled" ormtype="date" ;
    property name="tstamp" ormtype="date";

    property name="Article" fieldtype="one-to-many" cfc="publicationArticles" fkcolumn="publicationid";
}
Run Code Online (Sandbox Code Playgroud)

publicationArticles.cfc

component persistent="true" table="publicationArticles"  
hint="Publications"{
    property name="id" fieldtype="id" setter="false"   ;
    property name="typeid" ormtype="int";
    property name="title" ormtype="string" ;
    property name="status" ormtype="boolean";

    property name="publication" fieldtype="many-to-one" cfc="publications" fkcolumn="publicationid" ;
}
Run Code Online (Sandbox Code Playgroud)

publicationTypes.cfc

   component persistent="true" table="publicationTypes"    
hint="Publicatin Type - Lookup"{

    property name="id" fieldtype="id" setter="false"   ;
    property name="description" ormtype="string";

    property name="publications" fieldtype="one-to-many" cfc="publications" fkcolumn="typeid" ;
}
Run Code Online (Sandbox Code Playgroud)

Sea*_*lsh 4

您的房产需要一台发电机。

property name="id" fieldtype="id" generator="identity";
Run Code Online (Sandbox Code Playgroud)