因为整合了不同的系统,一套系统使用的是hibernate annotation,另一套系统使用的是hbm.xml
偷懒不想重构,又不想修改太多,所以决定整合hibernate annotations和hbm.xml
# <bean id="sessionFactory"
# class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
# <property name="dataSource" ref="dataSource" />
# <property name="mappingResources">
# <list>
# <value>cn/com/iolog/model/User.hbm.xml</value>
# <value>...</value>
# </list>
# </property>
#
# <property name="annotatedClasses">
# <list>
# <value>com.iolog.newcentury.model.user.User</value>
# <value>...</value>
# </list>
# </property>
# .......
# </bean>
#
<property name="mappingResources">指定映射文件
<property name="annotatedClasses">指定annotation类
载自:http://www.cnblogs.com/eafy
分享到:
相关推荐
都是用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.jar包,Hibernate可以应用在任何使用JDBC的场合,包含 hibernate-commons-annotations-4.0.1.Final.jar hibernate-core-4.1.12.Final.jar hibernate-ehcache-4.1.12.Final.jar hibernate-entitymanager-...
hibernate-commons-annotations-5.1.2.Final.jar
hibernate-commons-annotations-5.1.0.Final.jar
\hibernate-annotations-3.4.0.GA.chm中文版2个文件
hibernate-commons-annotations-4.0.1.Final.jar
解压后可得hibernate-annotations.jar和hibernate-annotations-src.zip,hibernate-annotations-src.zip为hibernate-annotations.jar的源代码
hibernate-annotations-3.4.0.GA+hibernate-distribution-3.3.2.GA完整jar包
hibernate-commons-annotations-5.0.1.Final.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
hibernate-commons-annotations-3.3.0.ga-sources.jar hibernate 源码
hibernate annotations 3.4.0.GA API
jackson-annotations-2.9.4.jar是jackson-annotations-2.9.4.jar是jackson-annotations-2.9.4.jar
hibernate-annotations-3.4.0.GA.jarhibernate-annotations-3.4.0.GA.jarhibernate-annotations-3.4.0.GA.jar
hibernate-annotations-3.4.0.GA.rar
最新jackson-annotations-2.8.9.jar