サンプルアプリのYABEのmodels/Tag.java のL27~あたりより抜粋 public static List<Map> getCloud() { List<Map> result = Tag.find( "select new map(t.name as tag, count(p.id) as pound) from Post p join p.tags as t group by t.name" ).fetch(); return result; } だが、少量の簡単なデータ取得なんかは、こちらの記述方法の方が向いているのでは。 |
playframework1 > jpa >