2017-08-14 54 views
-1
Query query = session.createQuery("from Stock where stockCode = :code "); 

說,我想用2列查詢,一個stockCode和其他與stockSample,我怎麼能做到這一點使用這個ORM映射?休眠,多在哪裏查詢

回答

0

這非常類似於普通的SQL:

from Stock where stockCode = :code and stockSample = :sample 
0

你不需要多個地方爲你必須使用邏輯運算符爲如AND或OR等 例如語句: - 你想從stockcode和stockSample那麼你可以使用AND運算符,

from Stock where stockCode = :code and stockSample = :code