LMLPHP后院

spring boot jpa 多个数据源配置

spring boot jpa 多数据源的配置,对于新手来讲还是不简单的,网上的很多资料都已经过时并且不靠谱。application.properties 配置参考:spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.html spring.thymeleaf.mode=LEGACYHTML5 spring.thymel...

springboot mybatis 多数据源配置

术,也就是熟练了这些,真正框架内部的东西是不可能熟练的,因为量太大,人生苦短。开始手把手教程,希望帮助到大家。maven 依赖配置:<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.2.1</version> </depe...

解决 springboot Interceptor @Autowired null

看如下代码块:package com.lmlphp.nb.config; import com.lmlphp.nb.interceptor.WebInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import ...

Spring Boot Jpa 使用原生 SQL 和动态分页

页报个错:Cannot use native queries with dynamic sorting and/or pagination in method public abstract org.springframework.data.domain.Page Jpa 的原生 SQL 对命名没有严格的要求,如下示例:package com.lmlphp.test; import org.springfra...

一颗巨星的陨落 CodeWeBlog

器,网络编程,站长经验,JSP编程,linuxshell,网络技术,数据库,Linux/apache,编程语言,C/C++,C++,系统架构,常用工具,开心网,Golang,正则表达式,AJAX相关,Spring,经验交流,node.js,nginx,unixlinux,服务器,PowerShell,表单特效,学习笔记,设计模式,Ubuntu,Lua,hadoop,js,extjs,J2EE,Maven,ja...

Spring boot jackson datetime 配置

Jackson 在遇到 datetime 类型的数据库字段会自动以时间戳数字的方式输出,该如何输出日期字符串呢?spring.jackson.date-format=yyyy-MM-dd HH:mm:ss 在使用的时候,发现有个 8 小时的时间差,解决方案在 application.properties 文件里面添加 spring.jackson.time-zone=GMT+8。 如果返回出来的时间数据需要固...

thymeleaf 模板对未闭合标签解析出错

thymeleaf 模板对 HTML 文件标签内容太严格的解决方式。1. 在 application.properties 文件中添加如下配置: spring.thymeleaf.mode=LEGACYHTML52. 对于 maven 用户,在 pom.xml 的 dependencies 中添加如下依赖:<dependency> <groupId>net.sourceforge.nekohtml</grou...

数据库 datetime 类型默认值引起 jdbc 报错

t be represented as java.sql.Timestamp 解决方案,参考如下 jdbc 配置,加上 zeroDateTimeBehavior=convertToNull 解决问题。spring.datasource.url=jdbc:mysql://192.168.1.122:3306/db_name?useSSL=true&useUnicode=true&characterEncodin...

无聊的春节

无聊的春节。 这或许是二月份唯一一篇文章啦,这个年过得……。沉默吧;做个伟人吧。...
2024-04-18 09:42:26 1713404546 0.024202