I am wanting to populate a form from an entity, and didn’t see anything in ColdBox that might do the trick. So I began to roll my own and came across this problem where the previously saved data is grabbed.
var objMember = ORMService.new(‘Member’);
var objData = getMetaData(objMember).properties;
writeDump(objData); abort;
Now if I dump objMember it is 100% empty as expected, but the moment I use getMetaData, it populates the objData with previous data from a previous entity save.
The only thing I have seen with metadata is that in cf9 it is cached, meaning that if you do a direct reference and manipulate it in any way, the changes remain in effect. This is a CF issue as far as I have seen it. So everything we do in ColdBox with metadata we try to either duplicate it or not modify it.
Yeah I figured that it was cached, it just through me that I was creating a completely new entity. Kinda makes sense for performance issues.
But if you have a better way of taking the entity and populating a form, I would appreciate it. Was hopping that CB had something, I could see a getProperties, but I also needed the values of the properties as well.