public List<SimpleCity> listByProvinceId(int provinceId) {
EntityManager em = entityManagerFactory.createEntityManager();
Query query = em.createQuery("select new com.jiapeng.xfw.server.normalClass.SimpleCity(c.province.id,c.province.name,c.id,c.name,c.distList.size) " +
"from City c where c.province.id =? order by c.id");
query.setParameter(1,provinceId);
List<SimpleCity> list = query.getResultList();
em.close();
return list;
}

c.distList.size就是统计的,在City类中定义的属性是这样的

@OneToMany(mappedBy = "city")
private