[Coldbox 4.3.0] No entity (persitent component) with name[]

Hi,

I am trying to build a project using ORM. I have set up the datasource in the web server. I have installed cborm and enable injection in Application.cfc. The setting in Coldbox.cfc is as following.

this.mappings["\cborm"]=COLDBOX_APP_ROOT_PATH&“modules/cborm”;

//orm settings

this.ormEnabled = true;

this.datasource=“mock”;

this.ormSetting={

cflocation=“models”,

dbcreate=“update”,

logSQL=TRUE,

flushAtRequestEnd=false,

autoManageSession=false,

eventHandling=true,

eventHandler=“cborm.models.eventHandler”

};

The thing is when I create a ORM entity in the command box and automatically generate the entity.cfc in cfscript
(e.g. ip_whitelist(id, ip,is_active))
At this moment, call some function to retrieve data from the table works fine.
However, since my project is all using cftag, so I change the script to tag. Then, the error msg shows

No entity (persitent component) with name [ip_whitelist] found, available entities are [exercise_year, programmes, users, participants]

Also, I tried to add things like extends=“cborm.models.ActivityEntity” to the entity.cfc, does not work either.
Even I switch back to the script, it does not work.
(All of the above action, I have reinit the cold box)
(It seems it only works at the first time I generate the entity.cfc)
The strange thing is sometimes it works and sometimes it doesn’t. And I have in total five tables in the schema, the “available entities” in error msg keeps changing randomly as well. Sometimes, there is no available entities. But I swear I did not modify those code.
I feel really frustrated finding which one went wrong. I mean it is just a mapping to the database, nothing difficult. And the set up of every entity.cfc is same too. I wonder if there is anyone else also encounter similar problems.

I am appreciate if anyone could offer any help. Thanks a lot for your patience.

Jiamin

Hi Jiamin,

You can add “skipCFCWithError= false” in your this.ormSetting and this will throw the error if there any problem with any entity file.

Secondly whenever you make changes in ORM entity files, you have to call ORMReload() function to pickup changes.

Hi Sana,
Thanks a lot for your suggestion.
However, it still does not work.

Jiamin