JPQL

JPQL(Java Persistence Query Language )是基於首次在EJB2.0中引入的EJB查詢語言。

概述

Java Persistence Query Language
基於首次在EJB2.0中引入的EJB查詢語言(EJB QL),Java持久化查詢語言(JPQL)是一種可移植的查詢語言,旨在以面向對象表達式語言的表達式,將SQL語法和簡單查詢語義綁定在一起.使用這種語言編寫的查詢是可移植的,可以被編譯成所有主流數據庫伺服器上的SQL.

選擇查詢

SELECT <select_expression>
FROM <from_clause>
&#91;WHERE <conditional_expression>&#93;
&#91;ORDER BY <order_by_clause>&#93;

聚合查詢

SELECT <select_expression>
FROM <from_clause>
&#91;WHERE <conditional_expression>&#93;
&#91;GROUP BY <group_by_clause>&#93;
&#91;HAVING <conditional_expression>&#93;
&#91;ORDER BY <order_by_clause>&#93;

更新查詢

UPDATE <entity name>&#91; &#91;AS &#93; <identification variable>&#93;
SET <update_statement>{,<update_statement>}*
&#91;WHERE <conditional_expression>&#93;

刪除查詢

DELETE FROM <entity name>&#91; &#91;AS &#93; <identification variable>&#93;
&#91;WHERE <conditional_expression>&#93;

熱門詞條

聯絡我們