共 8 篇文章 |
|
hibernate中clob处理。OSCacheProvider</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.dialect">org.hibernate.dialect./** default construct... 阅768 转4 评0 公众公开 13-03-21 10:46 |
hibernate的Restrictions用法。今天用了写hibernate高级查询时用了Restrictions(当然Expression也是可以以的)这个类.感觉不错.下面的代码写的不易读.其实核心就是一句Restrictions.or(Restrictions.like(),Restrictions.or(Restrictions.like,........))里面的or可以无限加的.还是比较好用。List<Film> list = criteria.add( ... 阅1517 转1 评0 公众公开 12-12-10 15:36 |
阅2403 转9 评0 公众公开 12-09-14 00:06 |
public List findByProperty(String propertyName, Object value) { log.debug("finding Users instance with property: "+ propertyName + ", value: "+ value);} catch (RuntimeException re) { log.error("merge failed", re);public void attachDirty(Users instance) { log.debug("attaching d... 阅8656 转27 评0 公众公开 12-09-05 17:11 |
select cat.weight + sum(kitten.weight) from Cat cat join cat.kittens kittengroup by cat.id, cat.weight.select distinct cat.name from Cat catselect count(distinct cat.name), count(cat) from Cat cat14.6. 多态查询。from Cat as cat where cat.id = 123from Cat as cat where cat.mate.id = 69.from Cat as cat where not ( cat.na... 阅84 转1 评0 公众公开 12-08-24 12:42 |
Hibernate配置文件:/src/hibernate.cfg.xml:<?xml version=''1.0'' encoding=''UTF-8''?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"... 阅696 转5 评0 公众公开 12-08-23 17:29 |