如何在标准API中编写DDL?
考虑以下代码 如何删除所有 JPA 实体? 此处的文档 http://download.oracle .com/docs/cd/E17410_01/javaee/6/tutorial/doc/gjitv.html 仅描述查询。
Consider the code in
How do I delete all JPA entities?
The documentation here http://download.oracle.com/docs/cd/E17410_01/javaee/6/tutorial/doc/gjitv.html
describes only queries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Criteria API 的文档仅描述查询,因为 Criteria API 不是为 DDL 操作而设计的。事实上,我什至会说整个 JPA API 并不是真正为此而设计的。
顺便说一句,另一个问题的代码不显示 DDL 操作,它显示 JPA 2.0 规范中描述的批量 DML 操作:
The documentation of the Criteria API describes only queries because the Criteria API is not made for DDL operations. Actually, I'd even say that the whole JPA API is not really made for that.
And by the way, the code of the other question doesn't show DDL operations, it's shows bulk DML operations which are described in the JPA 2.0 specification:
我认为标准 API 中没有 DDL。 JPQL 中也没有。
I think there is no DDL in criteria API. Nor in JPQL.