`
zwhc
  • 浏览: 258672 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

hibernate like in 多表 查询

    博客分类:
  • java
阅读更多
	public List getMaintainList(String persId, String status) {
		String[] aStat = status.split(",");
		String param = "?";
		for(int i=1; i<aStat.length; i++)
		{
			param += ",?";
		}
		String hql = "select m.mtnId, m.devName, m.positionName from Maintain m, Planning p " +
		"where m.planId = p.planId and p.beginDate<sysdate and p.endDate>sysdate" +
		" and m.persIds like ? and m.status in ( " + param + ") ";
		String pPersId = "%;" + persId + ";%";
		Object[] oParam = new Object[aStat.length+1];
		oParam[0] = pPersId;
		for(int i=1; i<oParam.length; i++)
		{
			oParam[i] = new Long(aStat[i-1]);
		}
		List list = findListByHql(hql, oParam);
		
		return list;
	}

0
2
分享到:
评论

相关推荐

    Hibernate Search In Action

    Hibernate Search in Action aims not only at providing practical knowledge of Hibernate Search but also uncovering some of the background behind Hibernate Search’s design. We will start by describing ...

    Hibernate Search in Action

    Along the way, the reader masters performance-boosting concepts like using Hibernate Search in a clustered environment and integrating with the features already in your applications. This book ...

    Hibernate HQL教程

    1.4 HQL的多表查询 17 1.4.1 表之间的关联关系 17 1.4.2 表中的数据 18 1.4.3 修改持久化类 19 1.4.4 在映射文件中加入关联信息 20 1.4.5 左外连接 21 1.4.6 左外抓取连接 23 1.4.7 右外连接 24 1.4.8 内连接 24 ...

    解決 SQL Server & Hibernate 一起使用,造成死結問題

    This is a bit like the way Hibernate uses optimistic locking for versioned objects. The benefit is that lock contention is totally removed because there aren’t any locks on rows! This means that ...

    AspectJ in Action: Enterprise AOP with Spring Applications

    Readers will find this edition immensely helpful in answering questions like: What are the ways to leverage these technologies? What applications is AOP suitable for? What are the best practices and ...

    hibernate-generic-dao:自动从code.google.comphibernate-generic-dao导出

    =,LIKE,IN,IS NULL和IS EMPTY)对属性进行过滤。 使用(SOME,ALL,NONE)过滤集合和关联。 将单个过滤器与逻辑运算符(AND,OR,NOT)的任意组合组合。 按属性排序。 分页。 从客户端代码远程定义搜索。 ...

    JAVA代码审计之SQL注入

    1、JDBC连接方式下sql注入的存在的形态及修复方法,like、in情况在如何安全使用预处理来防范sql注入 2、在使用Mybatis框架下如何审计sql注入代码,并详细的介绍了如何编写安全的数据库查询语句。 3、在使用Hibernate...

    AspectJ in Action

    Readers will find this edition immensely helpful in answering questions like: What are the ways to leverage these technologies? What applications is AOP suitable for? What are the best practices and ...

    Portlets in action

    Portlets in Action is a comprehensive guide to building portlet-driven applications in Java. It teaches portlet development hands-on as you develop a portal that incorporates most key features of the ...

    Learning PostgreSQL(PACKT,2015)

    PostgreSQL is one of the most powerful and easy to use database management ... Finally by the end of the book, you'll learn to use the JDBC driver and manipulate data objects in the Hibernate framework.

    Grails: A Quick-Start Guide

    We’ll see how Grails allows us to use powerful frameworks like Spring and Hibernate without even knowing it. Using this hands-on, pragmatic approach, we’ll explore topics such as AJAX in Grails, ...

    Pro Spring 3

    How to build transaction engines for your enterprise application and take advantage of other middle-tier features in Spring How to build Spring-based web applications using Spring MVC and more How to ...

    Google Guice: Agile Lightweight Dependency Injection Framework

    * How to develop a full stack Guice / Struts 2 / Hibernate application. * What you can really do with modern Java. Who is this book for? This book is for professional Java developers who are ...

    ORM软件monalisa-orm.zip

    for(User x:User.WHERE().name.like("zzg%").status.in(0, 1).SELECT().select()){ System.out.println(x); } //SQL: SELECT * FROM `user` WHERE (`name` like 'zzg%' AND `status` &gt;= 0)  // OR (`name` = '...

    springmybatis

    mybatis实战教程mybatis in action之四实现关联数据的查询 mybatis实战教程mybatis in action之五与spring3集成附源码 mybatis实战教程mybatis in action之六与Spring MVC 的集成 mybatis实战教程mybatis in action...

    ARCH4系统开发指南

    2.1.2.1 Like 9 2.1.2.2 In 10 2.1.2.3 Between 10 2.1.2.4 Equal 10 2.1.2.5 NotEqual 10 2.1.2.6 GreaterThan 10 2.1.2.7 GreaterEqual 11 2.1.2.8 LessThan 11 2.1.2.9 LessEqual 11 2.1.2.10 直接Sql限制 11 2.1...

    Spring Recipes: A Problem-Solution Approach, Second Edition

    This book is for Java developers who would like to rapidly gain hands-on experience with Java/Java EE development using the Spring framework. If you are already a developer using Spring in your ...

    工程硕士学位论文 基于Android+HTML5的移动Web项目高效开发探究

    Webview window in android used to load pages just works like browser, as well as there is only one webview running at the same time. (2)Cross-domain data interaction. Different webviews can not share...

    千方百计笔试题大全

    194、In a architecture pattern like MVC, it is mandatory that Servlet should be the controller, why not JSP? 46 195、Why JSP is used as View part of MVC ? 46 196、Can a database connection pool be ...

    java面试宝典

    194、In a architecture pattern like MVC, it is mandatory that Servlet should be the controller, why not JSP? 46 195、Why JSP is used as View part of MVC ? 46 196、Can a database connection pool be ...

Global site tag (gtag.js) - Google Analytics