jpa SQL Error: 17006, SQLState: null

jpa SQL Error: 17006, SQLState: null

could not read column value from result set: ID; 列名无效

 

查询语句:

String sql = "select A.SOURCE_CODE from  TB_PROSPECT_SOURCES A where Lower(A.SOURCE_CODE) = Lower('"+code+"')";
  Query query = this.getEntityManager().createNativeQuery(sql);
  List l = new ArrayList();
  l.add(query.getResultList());

将sql表的指段写全,或者 select * ,错误消失

你可能感兴趣的:(error)