问题
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