Query q = em.createQuery("SELECT u FROM SSUser u WHERE u.emailId=?1")
.setParameter(1, email);
我認爲這將是一個有效的查詢,但後來我得到: No results for query: SELECT FROM SSUser u WHERE u.emailId=?1
什麼來表達這個查詢的正確
假設以下班級,您如何找到帶有特定電子郵件地址的Person? public class Person implements Comparable<Person> {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="id")
private long id = 0;
我想檢索許多共同擁有一個「角色」的「Access」。 它的命名查詢: SELECT access
FROM Access AS access
WHERE :role MEMBER OF access.listRole
的訪問實體 public class Access implements Serializable {
@Id
@GeneratedValue(strat
我想寫一個JPQL查詢使用ORDER BY子句子句: query = "SELECT c FROM item ORDER BY c.name ASC"
我想設置一個「秩序」的參數,它的值是不是「ASC」或 「降序」: query = "SELECT c FROM item ORDER BY c.name :order"
然後在我的實現: query.setParameter("order"
可以在JPQL中做這個sql查詢的等價物嗎? SELECT *
FROM COUNTRIES c WHERE COUNTRY_ID IN (
SELECT DISTINCT COUNTRY_ID
FROM PORTS p
WHERE p.COUNTRY_ID = c.COUNTRY_ID AND STATE = 'A'
)