<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>/com/yese/domain/Bulletin.hbm.xml</value>
<value>/com/yese/domain/User.hbm.xml</value>
<value>/com/yese/domain/RoleProgram.hbm.xml</value>
<value>/com/yese/domain/Role.hbm.xml</value>
<value>/com/yese/domain/QuestionOption.hbm.xml</value>
<value>/com/yese/domain/Question.hbm.xml</value>
<value>/com/yese/domain/ProgramRecommend.hbm.xml</value>
<value>/com/yese/domain/ProgramPhase.hbm.xml</value>
<value>/com/yese/domain/ProgramDownloadLog.hbm.xml</value>
<value>/com/yese/domain/ProgramCategory.hbm.xml</value>
<value>/com/yese/domain/Program.hbm.xml</value>
<value>/com/yese/domain/Mail.hbm.xml</value>
<value>/com/yese/domain/ArticleCategory.hbm.xml</value>
</list>
</property>
<property name="annotatedClasses">
<list>
<value>com.yese.domain.Article</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.autoReconnect">true</prop>
<prop key="hibernate.bytecode.use_reflection_optimizer">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">com.yese.cache.memcached.MemcachedCacheProvider</prop>
<prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
<prop key="hibernate.search.default.indexBase">c:/indexes</prop>
<!--
<prop key="hibernate.search.analyzer"></prop>
-->
<prop key="memcached.servers">192.168.1.32:12000</prop>
<prop key="memcached.failover">true</prop>
<prop key="memcached.initConn">10</prop>
<prop key="memcached.minConn">10</prop>
<prop key="memcached.maxConn">1000</prop>
<prop key="memcached.maintSleep">30</prop>
<prop key="memcached.nagle">false</prop>
<prop key="memcached.socketTO">3000</prop>
<prop key="memcached.aliveCheck">true</prop>
<!-- memcached -->
<!--
<prop key="memcached.org.hibernate.cache.StandardQueryCache">30s</prop>
<prop key="memcached.org.hibernate.cache.UpdateTimestampsCache">30s</prop>
<prop key="memcached.com.yese.domain.Article">30s</prop>
<prop key="memcached.com.yese.domain.Mail">30s</prop>
-->
</props>
</property>
</bean>
<property name="mappingResources">指定映射文件
<property name="annotatedClasses">指定annotation类
分享到:
相关推荐
都是用Annotation(注解)方式来完成实体与表之间的映射关系,这样看起来比用xml文件来映射更具有可读性,自我感觉以后Hibernate Annotation的映射方式将代替hibernate 的*.hbm.xml映射方式
hibernate-annotations-3.4.0.GA hibernate-annotations-3.4.0.GA hibernate-annotations-3.4.0.GA
hibernate-commons-annotations-4.0.1.Final.jar hibernate-core-4.1.12.Final.jar hibernate-ehcache-4.1.12.Final.jar hibernate-entitymanager-4.1.12.Final.jar hibernate-jpa-2.0-api-1.0.1.Final.jar ...
hibernate-commons-annotations-5.1.0.Final.jar
hibernate-commons-annotations-5.1.2.Final.jar
\hibernate-annotations-3.4.0.GA.chm中文版2个文件
解压后可得hibernate-annotations.jar和hibernate-annotations-src.zip,hibernate-annotations-src.zip为hibernate-annotations.jar的源代码
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-annotations-3.4.0.GA+hibernate-distribution-3.3.2.GA完整jar包
hibernate-annotations-3.4.0.GA.rar 提供hibernate与annotation的配置包,一般现在的版本是3.5的版本,而3.5版本里面的参考文档不是很齐全,因此老版本的hibernate包还是有用的
hibernate-annotations-3.4.0.GA架包和slf4j-1.5.8架包
包含: hibernate3.jar; hibernate3-annotations.jar; hibernate3-commons-annotations.jar
jackson-annotations-2.9.4.jar是jackson-annotations-2.9.4.jar是jackson-annotations-2.9.4.jar
hibernate-commons-annotations-5.0.1.Final.jar的源码
hibernate-commons-annotations-3.3.0.ga-sources.jar hibernate 源码
hibernate annotations 3.4.0.GA API
hibernate-annotations-3.4.0.GA.jarhibernate-annotations-3.4.0.GA.jarhibernate-annotations-3.4.0.GA.jar
最新jackson-annotations-2.8.9.jar
hibernate-annotations-3.4.0.GA.rar