CF9 中持久性 CFC 的 New/CreateObject() 与 EntityNew() 之间的区别?

发布于 2024-08-02 19:08:20 字数 79 浏览 4 评论 0原文

在 CF9 中为持久 CFC 创建对象的 New/CreateObject() 与创建实体的 EntityNew() 之间有什么区别(如果有)?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

终遇你 2024-08-09 19:08:20

使用 New() 和 CreateObject() 时,您需要指定 CFC 的完整路径。

使用EntityNew(),您只需要传入实体的名称。

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.

陪我终i 2024-08-09 19:08:20

引用自: 学习 ColdFusion 9:EntityNew() 与 NEW 运算符/CreateObject()

我实际上问过这个问题
CFUNITED 的“高级 ORM”会议
并得到了略有不同的答案。
演讲者(请原谅我没有
记住他的名字 - 我想他是
Adobe 首席工程师)告诉我
当您使用加载对象时
EntityNew(),实际上是ColdFusion
以稍微不同的方式呈现它
比标准 CFC 的方式。虽然这
差异不明显
程序员,使用创建的组件
EntityNew() 确实提供了一些
Hibernate 的效率
集成水平。就这样,他
建议所有新启用 ORM 的
使用 EntityNew() 创建对象。

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().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文