随笔分类 -  hibernate

摘要:Caused by: org.hibernate.InvalidMappingException: Unable to read XML at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:10... 阅读全文
posted @ 2014-10-09 10:57 keia 阅读(1557) 评论(0) 推荐(0)
摘要:select 1 from table 如果该表有记录,则得到常量1,有多少条记录就得到多少条1select 1 from table where status=-1 limit 1有这种状态的记录返回1 。如果没有这种状态的记录返回空 阅读全文
posted @ 2014-04-04 20:13 keia 阅读(257) 评论(0) 推荐(0)
摘要:org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query;SQL [hql语句 limit 2000]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query在HQL+MYSQL中不能直接在查询语句中使用LIMIT进行检索,正确方法为:Query query = session.createQuery(hql);query.setFirstResult( 阅读全文
posted @ 2013-12-02 15:23 keia 阅读(452) 评论(0) 推荐(0)