Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Product というクラスがあります。各製品には serial_number があります。リストにある serial_number を持つすべての製品を返品したいと考えています。何かのようなもの
Restrictions.eq("serial_number", mySerialNumberList);
それは簡潔に行うことができますか、それとも多くの「OR」プロパティがスローされた巨大なクエリを作成する必要がありますか?
それがINオペレーターの目的です:
IN
Restrictions.in("serialNumber", mySerialNumberList);
ただし、注意してください。空のリストを渡すと、SQL文法例外が発生します。