配置文件里Entity类配置

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
  <!-- 配置Hibernate拦截器,自动填充数据的插入、更新时间 -->
  <property name="entityInterceptor" ref="entityInterceptor" />
  
  
  <property name="dataSource" ref="dataSource" />
  <property name="hibernateProperties">
   <value>
    <!-- 设置数据库方言 -->
    hibernate.dialect=${hibernate.dialect}
    <!-- 设置自动创建|更新|验证数据库表结构 -->
    hibernate.hbm2ddl.auto=update
    <!-- 输出SQL语句到控制台 -->
    hibernate.show_sql=${hibernate.show_sql}
    <!-- 格式化输出到控制台的SQL语句 -->
    hibernate.format_sql=${hibernate.format_sql}
    <!-- 是否开启二级缓存 -->
    hibernate.cache.use_second_level_cache=false
    <!-- 配置二级缓存产品 -->
    hibernate.cache.provider_class=org.hibernate.cache.OSCacheProvider
    <!-- 是否开启查询缓存 -->
    hibernate.cache.use_query_cache=false
    <!-- 数据库批量查询数 -->
    hibernate.jdbc.fetch_size=50
    <!-- 数据库批量更新数 -->
    hibernate.jdbc.batch_size=30
   </value>
  </property>

  <property name="annotatedClasses">
   <list>
       <value>com.lenovo.lps.psb.pushmarketing.entity.SelectList</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.Area</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.LogConfig</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.Log</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.Admin</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.Role</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.Resource</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.DeviceInfoVO</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.DeviceDimenInfo</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.PushTaskInfo</value>
    <value>com.lenovo.lps.psb.pushmarketing.entity.PushTaskFeedback</value>
   </list>
  </property>
 </bean>

你可能感兴趣的:(配置文件里Entity类配置)