hibernate-hql小结
hibernate------hql总结???????? Query query session.createQuery(hql)?????????? //默认查询出来的li
hibernate------hql总结
?
??????? Query query = session.createQuery(hql);???
??????? //默认查询出来的list里存放的是一个Object数组,但是在这里list里存放的不再是默认的Object数组了,而是List集合了???
??????? List<List> list = query.list();???
??????? for(List user : list){???
??????????? String name = (String)user.get(0);???
??????????? String passwd = (String)user.get(1);???
???????????????
??????????? System.out.println(name + " : " + passwd);???
??????? }???
??????? /**??
??????? 输出结果为:??
???????? name1 : password1??
??????? name2 : password2??
??????? name3 : password3??
???????? */?
5.修改默认查询结果(query.list())不以Object[]数组形式返回,以Map形式返回?
7.修改默认查询结果(query.list())不以Object[]数组形式返回,以自定义类型返回?
自定义类:?
??
"password1",Hibernate.STRING);?????
font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38p