摘要: 突然間感覺身體有很多問題,而我的年齡才只有20多歲,簡直不敢相信,一場感冒的突襲,竟持續(xù)1月之久,至今,我都沒有完全康復(fù),隨之而來的又是一系列其它的不適,我不知道,自己的身體究竟怎么了?我才只有20多歲,身體竟然如此不堪一擊。忽然想起,近年來,真的很好鍛煉身體,白天上班做一天,而上下班不是地鐵就是公交,走路很少,回到家里更是很少外出?;旧弦彩亲?,吃飯坐著,看電視坐著,打電腦還是坐著。每天10幾個小時奉獻(xiàn)給了“作者”..
閱讀全文
Error creating bean with name 'sessionFactory' defined
更多是因為jar包沖突所致,asm-util-2.2.3,asm-2.2.3,asm-commons-2.2.3 這三個保留第二個。
另外,關(guān)于用eclipse自動添加spring支持,生成的applicationContext.xml文件里定義的內(nèi)容:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
應(yīng)該改為:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
摘要: 1.對查詢進(jìn)行優(yōu)化,應(yīng)盡量避免全表掃描,首先應(yīng)考慮在 where 及 order by 涉及的列上建立索引。
2.應(yīng)盡量避免在 where 子句中對字段進(jìn)行 null 值判斷,否則將導(dǎo)致引擎放棄使用索引而進(jìn)行全表掃描,如:
select id from t where num is null
可以在num上設(shè)置默認(rèn)值0,確保表中num列沒有null值,然后這樣查詢:
select id from t where num=0
閱讀全文