首页 > 编程语言 > 详细

查询id》5000,标题有java的书

时间:2015-11-14 16:31:29      阅读:259      评论:0      收藏:0      [点我收藏+]

package com.haha.test;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.criterion.Example;

import com.haha.dao.HibernateSessionFactory;
import com.haha.info.Books;

public class Test1 {


public static void main(String[] args) {
BookWhere1 bk=new BookWhere1();
bk.setId(5000);
bk.setName("java%");

Query qq=HibernateSessionFactory.getSession()
.createQuery("from Books where id>:id and title like :name");

qq.setProperties(bk);

List<Books> list=qq.list();
for(Books b:list){
System.out.println(b.getId()+","+b.getTitle());
}

}

}

 

查询id》5000,标题有java的书

原文:http://www.cnblogs.com/tian114527375/p/4964541.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!