今天用到的一个 HQL知识点,总结一下,嘿嘿!

xiaoxiao2026-04-17  1

示例: 数据库采用oracle 在pl/sql中输入: using 916/123456 建表语句: create table example(id number(12) primary key not null, name varchar(12)); 当采用hql语句查询出如下记录时: hql = "select * from example" Query query = session.createQuery(hql); List list = query.list(); 那么我们如何取出id name 字段值呢? 方法: Object[] Ob = list.get(0); //取出整条记录; id = Ob.get(0); name = Ob.get(1);
转载请注明原文地址: https://www.6miu.com/read-5047527.html

最新回复(0)