equipment is not 地图ped 哈哈

equipment is not mapped 哈哈public List allEquipment() {Session session MySessionFactory.getSessi

equipment is not mapped 哈哈

public List allEquipment() {Session session = MySessionFactory.getSession();List list = new ArrayList();Transaction ts = null;try {ts = session.beginTransaction();String HQL = "select a from Equipment as a order by a.id";Query query = session.createQuery(HQL);list = query.list();ts.commit();} catch (Exception e) {ts.rollback();System.out.println("查询所有,系统出现错误,原因为:");e.printStackTrace();}finally{MySessionFactory.closeSession();}return list;}

?注意sql 语句

上面:String HQL = "select a from equipment as a order by a.id";
下面:String HQL = "select a from Equipment as a order by a.id";
这个家伙大小写不行啊。。。