EntityManager的指定字段查询方式
StringBuffer sql = new StringBuffer( "SELECT i.project.id,i.id,i.elementType FROM IntegratInfo i where i.id=55956");
List<Object[]> query = em.createQuery(sql.toString(), Object[].class).getResultList();// Query(sql.toString(),
System.out.println(query.size());
for (Object[] obj : query) {
System.out.println("i.project.id--->" + obj[0]);
System.out.println("i.id -->" + obj[1]);
System.out.println("i.elementType--->" + obj[2]);
}