gembin

          OSGi, Eclipse Equinox, ECF, Virgo, Gemini, Apache Felix, Karaf, Aires, Camel, Eclipse RCP

          HBase, Hadoop, ZooKeeper, Cassandra

          Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.

          There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.

          About Me

           

          JPA Criteria API


          Count
          CriteriaBuilder critBuilder = entityManager.getCriteriaBuilder();
          CriteriaQuery<Long> critQuery = criteriaBuilder.createQuery(Long.class);
          Root<Foo> root = critQuery.from(Foo.class);
          critQuery.select(critBuilder.countDistinct(root));
          int count = entityManager.createQuery(critQuery).getSingleResult().intValue();


           

           Result

          CriteriaBuilder critBuilder = entityManager.getCriteriaBuilder(); 
          CriteriaQuery<Long> critQuery = criteriaBuilder.createQuery(Long.class);
          Root<Foo> root = critQuery.from(Foo.class);
          critQuery.select(root).distinct(true);
          List<Foo> result = entityManager.createQuery(critQuery).getResultList();

          posted on 2013-03-06 13:44 gembin 閱讀(1721) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          導航

          統計

          常用鏈接

          留言簿(6)

          隨筆分類(440)

          隨筆檔案(378)

          文章檔案(6)

          新聞檔案(1)

          相冊

          收藏夾(9)

          Adobe

          Android

          AS3

          Blog-Links

          Build

          Design Pattern

          Eclipse

          Favorite Links

          Flickr

          Game Dev

          HBase

          Identity Management

          IT resources

          JEE

          Language

          OpenID

          OSGi

          SOA

          Version Control

          最新隨筆

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          free counters
          主站蜘蛛池模板: 基隆市| 遵义县| 大同市| 阿鲁科尔沁旗| 潢川县| 红桥区| 千阳县| 如东县| 田阳县| 新源县| 桐乡市| 莱阳市| 枣阳市| 喜德县| 察隅县| 合阳县| 绵竹市| 盐源县| 临颍县| 汕头市| 红安县| 桑植县| 上犹县| 运城市| 长宁区| 乌恰县| 桂阳县| 乌海市| 拉萨市| 莆田市| 巧家县| 庆元县| 全州县| 舟山市| 德保县| 海原县| 新平| 漳州市| 鱼台县| 宁南县| 墨竹工卡县|