为什么我在Eclipse项目中获得此标记?有人可以解释一下吗?或者给我一个解决方法
public Integer getAgenteId(Integer agente) {
try {
String sql = "SELECT id_agente FROM callcenter.agente WHERE agente = ? ";
EntityManager em = PersistenceUtil.getEntityManager();
Query q = em.createNativeQuery(sql);
q.setHint(QueryHints.RESULT_TYPE, ResultType.Map);
List<Map> lm = q.getResultList(); // ECLIPSE MARK HERE
for (Map rs : lm) { // ANOTHER ECLIPSE MARK HERE
return (Integer)rs.get("id_agente");
}
return null;
} catch (Exception e) {
logger.error("Erro (GetAgenteId) : " + e.getMessage());
e.printStackTrace();
}
return null;
}
public Integer getAgenteId(Integer agente) {
try {
String sql = "SELECT id_agente FROM callcenter.agente WHERE agente = ? ";
EntityManager em = PersistenceUtil.getEntityManager();
Query q = em.createNativeQuery(sql);
q.setHint(QueryHints.RESULT_TYPE, ResultType.Map);
List<Map> lm = q.getResultList(); // ECLIPSE MARK HERE
for (Map rs : lm) { // ANOTHER ECLIPSE MARK HERE
return (Integer)rs.get("id_agente");
}
return null;
} catch (Exception e) {
logger.error("Erro (GetAgenteId) : " + e.getMessage());
e.printStackTrace();
}
return null;
}
编辑:我不想发出警告,我想修正警告。