记录一次springBoot+hibernate+JPA+swagger2+链接人大金仓的项目demo
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- JPA --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <!-- 人大金仓 --> <!--kingbase8.jdbc--> <dependency> <groupId>com.kingbase8.jdbc</groupId> <artifactId>kingbase8</artifactId> <version>8.6.0</version> <scope>system</scope> <systemPath>${pom.basedir}/lib/kingbase8-8.6.0.jar</systemPath> </dependency> <!--hibinate-4--> <dependency> <groupId>hibernate-4</groupId> <artifactId>hibernate-4</artifactId> <version>4</version> <scope>system</scope> <systemPath>${pom.basedir}/lib/hibernate-4.dialect.jar</systemPath> </dependency> <!--swagger --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency>
server: port: 8090 tomcat: max-swallow-size: -1 servlet: context-path: /api compression: enabled: true min-response-size: 1024 mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/* spring: servlet: multipart: max-file-size: 10MB max-request-size: 10MB #json 时间戳统一转换 jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 aop: proxy-target-class: true # 设置静态文件路径,js,css等 mvc: static-path-pattern: /** resource: static-locations: classpath:/static/ jpa: # 是否在控制台展示sql show-sql: true # 如果实体类中添加新字段,或者没有表 创建新的表 hibernate: ddl-auto: update database-platform: org.hibernate.dialect.Kingbase8Dialect properties: current_session_context_class: org.springframework.orm.hibernate4.SpringSessionContext datasource: url: jdbc:kingbase8://127.0.0.1:54321/gis username: root password: 123456 driver-class-name: com.kingbase8.Driver hikari: pool-name: GreeHikariCp minimum-idle: 5 maximum-pool-size: 20 idle-timeout: 180000 max-lifetime: 180000 connection-timeout: 30000 connection-test-query: SELECT 1
岁月无声无息的溜走,除了带走一个无聊者的时光,还会沉淀一个努力者的人生。