该代码能够顺利通过编译,但将在运行时失败,因为该JPQL查询字符串的语法有误。
So far, I have mainly emphasized the strongly typed nature of the Criteria API and the fact that it helps to minimize syntactic errors that can creep into string-based JPQL queries.
到目前为止,我主要强调了CriteriaAPI的强类型,以及它如何帮助减少出现在基于字符串JPQL查询中的语义错误。