Repeated column in mapping for entity: user column: userid (should be mapped with insert="false" update="false")
That is the error message I'm getting. I've got a user table (customer) that is self-referential. That way I can tell which user created which and when.
Here is my entity.
component table="customer" output="false" accessors="true" persistent="true" {
property name="userid" column="userid" ormtype="int" fieldtype="id" generator="identity";
property name="firstname" column="firstname" ormtype="string";
property name="lastname" column="lastname" ormtype="string";
property name="email" column="email" ormtype="string";
property name="active" column="active" type="boolean" ormtype="boolean";
property name="createdOn" column="createdOn" ormtype="date";
property name="modifiedOn" column="modifiedOn" ormtype="date";
property name="createdBy" fieldtype="one-to-one" cfc="user" fkcolumn="userid" inverse="true";
property name="modifiedBy" fieldtype="one-to-one" cfc="user" fkcolumn="userid" inverse="true";
}
I've added what the error message tells me to add to each property so they now look like:
property name="createdBy" fieldtype="one-to-one" cfc="user" fkcolumn="userid" inverse="true" insert="false" update="false";
property name="modifiedBy" fieldtype="one-to-one" cfc="user" fkcolumn="userid" inverse="true" insert="false" update="false";
SOLUTION: I added inversejoincolumn="userid" and it worked. See below
property name="createdBy" column="createdBy" fieldtype="one-to-one" cfc="user" inversejoincolumn="userid";
property name="modifiedBy" column="modifiedBy" fieldtype="one-to-one" cfc="user" inversejoincolumn="userid";
OrmReload()? - CfSimplicityuseridproperty. But anyway it seems you need to create specific keys for your 2 self-referential relationships. - CfSimplicity