spring+jpa(hibernate) 配置文件代码
来源:互联网 发布:老司机网络用语 编辑:程序博客网 时间:2024/05/22 11:37
<?xml version="1.0" encoding="UTF-8"?><!-- @version $Id: applicationContext.xml 561608 2007-08-01 00:33:12Z vgritsenko $ --><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"> <!--开启注解扫描,不能扫描全部,因为jpa底层原理关系,所以不能使用spring扫描,--> <context:component-scan base-package="cn.itcast.bos.web.base.action,cn.itcast.bos.service.impl"/> <!-- 整合 spring data jpa --> <jpa:repositories base-package="cn.itcast.bos.dao" /> <!--开启事务注解扫描--> <tx:annotation-driven transaction-manager="transactionManager"/> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <!--连接池--> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/> <property name="jdbcUrl" value="jdbc:oracle:thin:@192.168.129.100:1521:orcl"/> <property name="user" value="xiaoyang"/> <property name="password" value="xy123"/> </bean> <!--spring 跟 jpa整合--> <!--配置factory--> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource"/> <!--包扫描,这个扫描的是 javaBean内容--> <property name="packagesToScan" value="cn.itcast.domain"/> <!--持久层使用hibernate框架--> <property name="persistenceProvider" > <bean class="org.hibernate.ejb.HibernatePersistence"/> </property> <property name="jpaVendorAdapter"> <!-- 自动建表 --> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="true"/> <property name="generateDdl" value="true"/> <property name="database" value="ORACLE"/> <!--其实就是数据库方言--> <property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect"/> </bean> </property> <property name="jpaDialect"> <!--hql hqpl--> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/> </property> </bean></beans>
阅读全文
0 0
- spring+jpa(hibernate) 配置文件代码
- spring+hibernate+jpa+Druid的配置文件,spring整合Druid
- spring jpa 的配置文件
- SPRING JPA 与 Hibernate JPA
- maven工程:spring+jpa(hhibernate)(cxf服务端配置文件代码)
- struts2+spring+jpa(hibernate)
- jpa+spring+hibernate
- 11.Spring + Hibernate + JPA
- Spring集成JPA(Hibernate)
- Spring + JPA + Hibernate配置
- Spring Boot JPA-Hibernate
- spring+hibernate+jpa配置
- hibernate(jpa)+spring
- spring + jpa + hibernate
- Spring+JPA+MySQL的配置文件
- SpringMVC +Hibernate JPA+Spring-data-jpa
- JPA Spring-Data-JPA hibernate mybatis
- spring data jpa和hibernate jpa
- [Java集合] 彻底搞懂HashMap,HashTable,ConcurrentHashMap之关联.
- MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.
- Oracle数据库导入导出DMP文件
- 针对Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决方案
- 初识node
- spring+jpa(hibernate) 配置文件代码
- Android HTTPS之自签名证书认证(二)
- layer弹出层的关闭及父页面的刷新问题
- js相等运算的规则
- IntelliJ IDEA 教程
- spark学习-59-Spark的动态资源分配ExecutorAllocationManager
- 全志A33平台编译linux(分色排版)V1.1
- Gradle 官方下载地址
- Linux中ping不通外网