返回顶部
首页 > 资讯 > 精选 >Spring Boot + Jpa(Hibernate) 架构基本配置详解
  • 774
分享到

Spring Boot + Jpa(Hibernate) 架构基本配置详解

springbootjpa 2023-05-31 14:05:22 774人浏览 泡泡鱼
摘要

基于SpringBoot-1.4.0.RELEASE版本测试springBoot + hibernate + Druid + MySQL + servlet(jsp)不废话,直接上代码一、maven的pom文件<?xml ve

基于SpringBoot-1.4.0.RELEASE版本测试

springBoot + hibernate + Druid + MySQL + servlet(jsp)

不废话,直接上代码

一、maven的pom文件

<?xml version="1.0" encoding="UTF-8"?>  <project xmlns="Http://Maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">    <modelVersion>4.0.0</modelVersion>    <groupId>com.zsx</groupId>    <artifactId>demo</artifactId>    <packaging>war</packaging>    <version>0.0.1</version>    <name>zsx Maven WEBapp</name>    <url>http://maven.apache.org</url>    <properties>      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>      <jdk.version>1.7</jdk.version>      <Tomcat.version>7.0.69</tomcat.version>    </properties>    <parent>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-parent</artifactId>      <version>1.4.0.RELEASE</version>    </parent>    <dependencies>      <!-- 添加对jsp视图解析的支持 -->      <dependency>        <groupId>org.apache.tomcat.embed</groupId>        <artifactId>tomcat-embed-jasper</artifactId>      </dependency>      <dependency>        <groupId>javax.servlet</groupId>        <artifactId>jstl</artifactId>      </dependency>      <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-web</artifactId>      </dependency>      <!-- 下面两个引入为了操作数据库 -->      <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-data-jpa</artifactId>      </dependency>      <dependency>        <groupId>Mysql</groupId>        <artifactId>mysql-connector-java</artifactId>      </dependency>      <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-tomcat</artifactId>         <scope>provided</scope>       </dependency>      <!-- 只需引入spring-boot-devtools 即可实现热部署 -->      <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-devtools</artifactId>      </dependency>      <!-- JSON包 -->      <dependency>        <groupId>com.alibaba</groupId>        <artifactId>fastjson</artifactId>        <version>1.2.16</version>      </dependency>      <!-- 为了监控数据库 -->      <dependency>        <groupId>com.alibaba</groupId>        <artifactId>druid</artifactId>        <version>1.0.25</version>      </dependency>      <dependency>        <groupId>org.apache.poi</groupId>        <artifactId>poi</artifactId>        <version>3.14</version>      </dependency>      <!-- Junit 单元测试 -->      <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-test</artifactId>        <scope>test</scope>      </dependency>      <dependency>         <groupId>io.springfox</groupId>         <artifactId>springfox-swagger2</artifactId>         <version>2.6.0</version>       </dependency>       <dependency>         <groupId>io.springfox</groupId>         <artifactId>springfox-swagger-ui</artifactId>         <version>2.6.0</version>       </dependency>    </dependencies>    <build>      <finalName>/</finalName>      <plugins>        <plugin>          <groupId>org.springframework.boot</groupId>          <artifactId>spring-boot-maven-plugin</artifactId>          <dependencies>            <!-- 热部署 -->            <dependency>              <groupId>org.springframework</groupId>              <artifactId>springloaded</artifactId>              <version>1.2.6.RELEASE</version>            </dependency>          </dependencies>        </plugin>      </plugins>    </build>    <repositories>      <repository>        <id>ali</id>        <name>ali Repository</name>        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>        <snapshots>          <enabled>false</enabled>        </snapshots>      </repository>    </repositories>  </project>

--结束END--

本文标题: Spring Boot + Jpa(Hibernate) 架构基本配置详解

本文链接: https://lsjlt.com/news/226217.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作