﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-mis98zb</title><link>http://www.blogjava.net/mis98zb/</link><description /><language>zh-cn</language><lastBuildDate>Tue, 28 Apr 2026 19:00:08 GMT</lastBuildDate><pubDate>Tue, 28 Apr 2026 19:00:08 GMT</pubDate><ttl>60</ttl><item><title>spring 1.2.X的事务配置</title><link>http://www.blogjava.net/mis98zb/archive/2006/08/22/65070.html</link><dc:creator>mis98zb</dc:creator><author>mis98zb</author><pubDate>Tue, 22 Aug 2006 06:47:00 GMT</pubDate><guid>http://www.blogjava.net/mis98zb/archive/2006/08/22/65070.html</guid><wfw:comment>http://www.blogjava.net/mis98zb/comments/65070.html</wfw:comment><comments>http://www.blogjava.net/mis98zb/archive/2006/08/22/65070.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/mis98zb/comments/commentRss/65070.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mis98zb/services/trackbacks/65070.html</trackback:ping><description><![CDATA[呵呵，用上spring2.0了，但是辛辛苦苦研究出来的1.2.x的配置方法也不忍心就这么扔了，放这里做个记录吧。<br />首先是基于Java5 Annotation的配置：<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">&lt;?</span><span style="color: rgb(255, 0, 255);">xml version="1.0" encoding="UTF-8"</span><span style="color: rgb(0, 0, 255);">?&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;!</span><span style="color: rgb(255, 0, 255);">DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">import<br />        </span><span style="color: rgb(255, 0, 0);">resource</span><span style="color: rgb(0, 0, 255);">="classpath:cn/com/nec/esmpro/gserver/util/database/database.beans.xml"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean<br />        </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Switch AOP function ON!</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean<br />        </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.transaction.interceptor.TransactionInterceptor"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="transactionManager"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.orm.hibernate3.HibernateTransactionManager"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="sessionFactory"</span><span style="color: rgb(255, 0, 0);"> ref</span><span style="color: rgb(0, 0, 255);">="gserverSessionFactoryBean"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="transactionAttributeSource"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">constructor-arg</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">&gt;</span></div>然后是只使用XML的配置：<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">&lt;?</span><span style="color: rgb(255, 0, 255);">xml version="1.0" encoding="UTF-8"</span><span style="color: rgb(0, 0, 255);">?&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;!</span><span style="color: rgb(255, 0, 255);">DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">import<br />        </span><span style="color: rgb(255, 0, 0);">resource</span><span style="color: rgb(0, 0, 255);">="classpath:cn/com/nec/esmpro/gserver/util/database/database.beans.xml"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean<br />        </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Switch AOP function ON!</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean<br />        </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="classFilter"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="???????????????????????????????????????"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="transactionInterceptor"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.transaction.interceptor.TransactionInterceptor"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="transactionManager"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="org.springframework.orm.hibernate3.HibernateTransactionManager"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="sessionFactory"</span><span style="color: rgb(255, 0, 0);"> ref</span><span style="color: rgb(0, 0, 255);">="gserverSessionFactoryBean"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="transactionAttributes"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">props</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">prop </span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="*"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">PROPAGATION_REQUIRED</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">prop</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">prop </span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="find*"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">PROPAGATION_REQUIRED,readOnly</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">prop</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">props</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">bean</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">beans</span><span style="color: rgb(0, 0, 255);">&gt;</span></div><br /><img src ="http://www.blogjava.net/mis98zb/aggbug/65070.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mis98zb/" target="_blank">mis98zb</a> 2006-08-22 14:47 <a href="http://www.blogjava.net/mis98zb/archive/2006/08/22/65070.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用hibernate Annotation时犯的低级错误</title><link>http://www.blogjava.net/mis98zb/archive/2006/08/10/62691.html</link><dc:creator>mis98zb</dc:creator><author>mis98zb</author><pubDate>Wed, 09 Aug 2006 16:41:00 GMT</pubDate><guid>http://www.blogjava.net/mis98zb/archive/2006/08/10/62691.html</guid><wfw:comment>http://www.blogjava.net/mis98zb/comments/62691.html</wfw:comment><comments>http://www.blogjava.net/mis98zb/archive/2006/08/10/62691.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/mis98zb/comments/commentRss/62691.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mis98zb/services/trackbacks/62691.html</trackback:ping><description><![CDATA[
		<p>写了半天，老是出现config为null的问题：</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #008080">1</span> <span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">015</span><span style="COLOR: #000000"> INFO </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.AnnotationConfiguration</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Mapping package cn.com.nec.esmpro.gserver.author<br /></span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000"></span><span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">093</span><span style="COLOR: #000000"> WARN </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.AnnotationBinder</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Package not found or wo package-info.java: cn.com.nec.esmpro.gserver.author<br /></span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000"></span><span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">093</span><span style="COLOR: #000000"> INFO </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.AnnotationConfiguration</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Mapping package cn.com.nec.esmpro.gserver.source<br /></span><span style="COLOR: #008080">4</span> <span style="COLOR: #000000"></span><span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">093</span><span style="COLOR: #000000"> WARN </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.AnnotationBinder</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Package not found or wo package-info.java: cn.com.nec.esmpro.gserver.source<br /></span><span style="COLOR: #008080">5</span> <span style="COLOR: #000000"></span><span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">750</span><span style="COLOR: #000000"> INFO </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.AnnotationConfiguration</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Mapping package cn.com.nec.esmpro.gserver.user_support<br /></span><span style="COLOR: #008080">6</span> <span style="COLOR: #000000"></span><span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">750</span><span style="COLOR: #000000"> WARN </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.AnnotationBinder</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Package not found or wo package-info.java: cn.com.nec.esmpro.gserver.user_support<br /></span><span style="COLOR: #008080">7</span> <span style="COLOR: #000000"></span><span style="COLOR: #000000">2006</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">08</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">00</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">37</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">54</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">750</span><span style="COLOR: #000000"> INFO </span><span style="FONT-WEIGHT: bold; COLOR: #800000">[</span><span style="COLOR: #800000">org.hibernate.cfg.Configuration</span><span style="FONT-WEIGHT: bold; COLOR: #800000">]</span><span style="COLOR: #000000"> - Configured SessionFactory: null</span></div>不知道什么原因。<br />:(<img src ="http://www.blogjava.net/mis98zb/aggbug/62691.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mis98zb/" target="_blank">mis98zb</a> 2006-08-10 00:41 <a href="http://www.blogjava.net/mis98zb/archive/2006/08/10/62691.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用DB4O 的问题</title><link>http://www.blogjava.net/mis98zb/archive/2006/07/12/57841.html</link><dc:creator>mis98zb</dc:creator><author>mis98zb</author><pubDate>Wed, 12 Jul 2006 09:33:00 GMT</pubDate><guid>http://www.blogjava.net/mis98zb/archive/2006/07/12/57841.html</guid><wfw:comment>http://www.blogjava.net/mis98zb/comments/57841.html</wfw:comment><comments>http://www.blogjava.net/mis98zb/archive/2006/07/12/57841.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/mis98zb/comments/commentRss/57841.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mis98zb/services/trackbacks/57841.html</trackback:ping><description><![CDATA[在使用DB4O的时候发现两个问题。<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">1</span> <span style="color: rgb(0, 0, 0);">        ObjectSet result </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> db.get(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Object());<br /></span><span style="color: rgb(0, 128, 128);">2</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (Object obj : result) {<br /></span><span style="color: rgb(0, 128, 128);">3</span> <span style="color: rgb(0, 0, 0);">            db.delete(obj);<br /></span><span style="color: rgb(0, 128, 128);">4</span> <span style="color: rgb(0, 0, 0);">        }<br /></span><span style="color: rgb(0, 128, 128);">5</span> <span style="color: rgb(0, 0, 0);">        db.commit();</span></div><br />第一行如果用<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">db.get(Object.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">)</span></div>则一个对象都取不出来，<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">db.get(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Object());</span></div>却可以把对象都取出来。<br />然而更奇怪的是第三行能够删掉大部分对象，却删不掉存在数据库里的enum类型的对象。<br />真是奇怪了……<br /><br /><img src ="http://www.blogjava.net/mis98zb/aggbug/57841.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mis98zb/" target="_blank">mis98zb</a> 2006-07-12 17:33 <a href="http://www.blogjava.net/mis98zb/archive/2006/07/12/57841.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>laszlo IDE的使用方法。</title><link>http://www.blogjava.net/mis98zb/archive/2006/06/01/49546.html</link><dc:creator>mis98zb</dc:creator><author>mis98zb</author><pubDate>Thu, 01 Jun 2006 05:28:00 GMT</pubDate><guid>http://www.blogjava.net/mis98zb/archive/2006/06/01/49546.html</guid><wfw:comment>http://www.blogjava.net/mis98zb/comments/49546.html</wfw:comment><comments>http://www.blogjava.net/mis98zb/archive/2006/06/01/49546.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/mis98zb/comments/commentRss/49546.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mis98zb/services/trackbacks/49546.html</trackback:ping><description><![CDATA[用laszlo IDE也有一段时间了，可惜一直不得其法，用的很是不爽。<br /><br />正规的用法大概是这样的：<br />创建一个laszlo类型的工程，设置好LPS Web Root，就可以在这个工程里开发lzx类型的代码了。<br />需要调试的时候，选中需要调试的canvas类型的lzx文件，在右键菜单中选择Run As ——〉Laszlo Application。<br />它会打开默认浏览器，用以调试这个lzx文件。<img src ="http://www.blogjava.net/mis98zb/aggbug/49546.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mis98zb/" target="_blank">mis98zb</a> 2006-06-01 13:28 <a href="http://www.blogjava.net/mis98zb/archive/2006/06/01/49546.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于Object到XML映射的一点想法</title><link>http://www.blogjava.net/mis98zb/archive/2006/05/04/44499.html</link><dc:creator>mis98zb</dc:creator><author>mis98zb</author><pubDate>Thu, 04 May 2006 01:00:00 GMT</pubDate><guid>http://www.blogjava.net/mis98zb/archive/2006/05/04/44499.html</guid><wfw:comment>http://www.blogjava.net/mis98zb/comments/44499.html</wfw:comment><comments>http://www.blogjava.net/mis98zb/archive/2006/05/04/44499.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/mis98zb/comments/commentRss/44499.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mis98zb/services/trackbacks/44499.html</trackback:ping><description><![CDATA[以前用WebWork的时候，因为选择了xml + xslt的方式，所以就要把object映射到xml。<br />最初想偷偷懒，不打算使用配置文件。于是就自己写了一个obj2xml，遇到了两个问题：<br /><br />☆首先就是环的问题。<br />xml是树形结构，不允许出现环的。而对象关系中，很容易出现环。比如<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">Parent.getChildren();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Child.getParent();</span></div>这样的代码。<br />我的解决方法是，在映射的时候，用hash map保存一个class到已知obj列表。不在已知列表里的，就先映射，然后加到已知obj列表里。在已知列表里的，就不再映射了。这样速度挺快，查找也方便。这个问题还算好解决。<br /><br />☆接下来就是垃圾信息的屏蔽。<br />我是用get*来映射的（当然，集合类型会有特殊的处理）。<br />但是，get*方法中赫然有getClass存在！而Class类又有一堆get方法！这还算好办，直接屏蔽掉Class类型好了。<br />问题在于用户自己的一些无用信息。比如<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">DomainObject.getXXXService();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />XXXServiceImpl.getYYYDAO();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />YYYDAO.getZZZDAOSupport();</span></div>还有就是多余的信息。比如我只想得到用户的基本信息，可是<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img id="Codehighlighter1_13_89_Open_Image" onclick="this.style.display='none'; Codehighlighter1_13_89_Open_Text.style.display='none'; Codehighlighter1_13_89_Closed_Image.style.display='inline'; Codehighlighter1_13_89_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_13_89_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_13_89_Closed_Text.style.display='none'; Codehighlighter1_13_89_Open_Image.style.display='inline'; Codehighlighter1_13_89_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Person </span><span id="Codehighlighter1_13_89_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.blogjava.net/images/dot.gif" /></span><span id="Codehighlighter1_13_89_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />    getName();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />    getAge();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />    getBirthday();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />    getEducationRecord();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img id="Codehighlighter1_113_157_Open_Image" onclick="this.style.display='none'; Codehighlighter1_113_157_Open_Text.style.display='none'; Codehighlighter1_113_157_Closed_Image.style.display='inline'; Codehighlighter1_113_157_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_113_157_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_113_157_Closed_Text.style.display='none'; Codehighlighter1_113_157_Open_Image.style.display='inline'; Codehighlighter1_113_157_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> EducationRecord</span><span id="Codehighlighter1_113_157_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.blogjava.net/images/dot.gif" /></span><span id="Codehighlighter1_113_157_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />    getMildSchool();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />    getUnivercity();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div>这样一来，本来不需要的教育的信息就会被映射到。由于Person对象可能会关联到很多对象，那样就会有很多无用的信息被包含进来。<br />对于这种情况，首先的想法就是LazyLoading。对于一般的使用，这是没有问题的。但是我的需求是要把XML发送到客户端。客户端会使用XML中的哪些数据，我的映射程序没有办法捕捉到。因此LazyLoading就毫无用武之地了。<br />没有办法，只能把责任推倒对被映射的object，让它注意不要包含无用的数据。可是这样一来，就要专门为映射准备一些bean，然后用BeanUtil给他们赋值，再传递给obj2xml。<br /><br />最后实在没有办法，干脆彻底抛弃我的obj2xml，自己写了一个xmlResult，使用vm来生成xml。<br />虽然为需要写一些vm，但是比起专门准备一堆bean再用obj2xml映射，还是要简单直接一些。<br />可能这也是没有什么特别好用的obj/xml映射工具的原因吧！<img src ="http://www.blogjava.net/mis98zb/aggbug/44499.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mis98zb/" target="_blank">mis98zb</a> 2006-05-04 09:00 <a href="http://www.blogjava.net/mis98zb/archive/2006/05/04/44499.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>试了一下XFire中把obj映射为xml的能力。</title><link>http://www.blogjava.net/mis98zb/archive/2006/05/04/44497.html</link><dc:creator>mis98zb</dc:creator><author>mis98zb</author><pubDate>Thu, 04 May 2006 00:25:00 GMT</pubDate><guid>http://www.blogjava.net/mis98zb/archive/2006/05/04/44497.html</guid><wfw:comment>http://www.blogjava.net/mis98zb/comments/44497.html</wfw:comment><comments>http://www.blogjava.net/mis98zb/archive/2006/05/04/44497.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/mis98zb/comments/commentRss/44497.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mis98zb/services/trackbacks/44497.html</trackback:ping><description><![CDATA[
		<p>最近终于想玩玩新技术了。试着用XFire做WS，用OpenLaszlo做客户端。<br />毫无疑问，当然使用的是XFire结合Spring的方式。<img height="19" src="http://www.blogjava.net/Emoticons/red_smile.gif" width="19" border="0" /><br />而且，作为一个地道的懒人，我首先就选择了最简单的基于SpringRPC的方式：</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">    </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">servlet</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">servlet-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">xfire</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">servlet-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">servlet-class</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">org.springframework.web.servlet.DispatcherServlet</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">servlet-class</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">servlet</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
		</div>可是这就带来了一个问题：<br />它是Document方式的，返回给客户端的数据都会被自动映射成XML。<br /><br />呵呵，这就引起了我的兴趣。<br />以前我也曾经写过一个obj2xml的映射工具，看看XFire的有没有什么过人之处。<br /><br />结果很令人失望，XFire连基本的环检测都没有做到，直接就用org.codehaus.xfire.aegis.type.basic.BeanType.writeObject()拼命写，一直写到java.lang.StackOverflowError。<br /><br />看来还是不能偷懒，得研究一下XBean方式。<br /><img height="19" src="http://www.blogjava.net/Emoticons/sad_smile.gif" width="19" border="0" /><img src ="http://www.blogjava.net/mis98zb/aggbug/44497.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mis98zb/" target="_blank">mis98zb</a> 2006-05-04 08:25 <a href="http://www.blogjava.net/mis98zb/archive/2006/05/04/44497.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>