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.
本文の長さが0〜25文字のメッセージの数をカウントするにはどうすればよいですか?
Message.countBy('from Message m where m.body.length <= 25')
私にとって残念なことにcountBy、文字列パラメータを取りません。
countBy
動的メソッドリファレンスを見ると、おそらく実行できる最善の方法は、次のexecuteQuery代わりに使用することですcount*。
executeQuery
count*
Message.executeQuery('select count(m) from Message m where SIZE(m.body) < 25')
編集:クエリの作成/実行に役立つ可能性のあるリンクをいくつか示します。