Differences between New/CreateObject() vs EntityNew() in CF9 for persistent CFC?

纵然是瞬间 提交于 2019-12-23 19:13:41

问题


What are the differences (if any) between New/CreateObject() to create an object vs EntityNew() to create an entity in CF9 for persistent CFC?


回答1:


With New() and CreateObject() you need to specify the full path to the CFC.

With EntityNew() you just need to pass in the name of the entity.




回答2:


quoted from: Learning ColdFusion 9: EntityNew() vs. The NEW Operator / CreateObject()

I actually asked this question during the "Advanced ORM" session at CFUNITED and got a slightly different answer. The speaker (forgive me for not remembering his name - I think he was the head Adobe engineer), told me that when you load an object using EntityNew(), ColdFusion actually presents it in a slightly different way than a standard CFC. While this difference is not noticeable to the programmer, a component created using EntityNew() does afford some efficiencies at the Hibernate integration level. As such, he recommended that all new ORM-enabled objects be created with EntityNew().



来源:https://stackoverflow.com/questions/1348724/differences-between-new-createobject-vs-entitynew-in-cf9-for-persistent-cfc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!