該代碼能夠順利通過編譯,但將在運行時失敗,因為該JPQL查詢字符串的語法有誤。
到目前為止,我主要強調了CriteriaAPI的強類型,以及它如何幫助減少出現在基於字符串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.