我正在尝试使用 Criteria 获得单列结果,但我没有得到完美的输出
Criteria criteria = session.createCriteria(GroupName.class)
.setProjection(Projections.property("groupName"));
criteria.createAlias("gcmUsers", "user").setResultTransformer(
Criteria.DISTINCT_ROOT_ENTITY);
criteria.add(Restrictions.eq("user.clientName", userName));
groupNames=criteria.list();
i am getting this output :
Default, Default, Default, Default, Default, Default, twiter_grp
but my actual output is :
Default, twiter_grp,friends