mirror of
https://gitee.com/many2many/java-web.git
synced 2025-01-11 14:40:55 +08:00
changed
This commit is contained in:
parent
bddbc01a24
commit
11aab361e1
@ -15,13 +15,13 @@ public class User {
|
||||
@Column(nullable = false)
|
||||
private String password;
|
||||
|
||||
@Column()
|
||||
|
||||
private String email;
|
||||
|
||||
@Column
|
||||
|
||||
private String phone;
|
||||
|
||||
@Column
|
||||
|
||||
private Integer age;
|
||||
|
||||
public String getName() {
|
||||
|
@ -30,7 +30,6 @@ public class UserService {
|
||||
|
||||
public User updateUser(Long id, User user){
|
||||
userRepository.findById(id).ifPresent(u->{
|
||||
// u.setName(user.getName());
|
||||
u.setPassword(user.getPassword());
|
||||
u.setEmail(user.getEmail());
|
||||
u.setPhone(user.getPhone());
|
||||
|
@ -1,42 +1,42 @@
|
||||
spring:
|
||||
jackson:
|
||||
property-naming-strategy: SNAKE_CASE # 驼峰转下划线
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/demo?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true # MySQL连接URL,paopao是数据库名
|
||||
driverClassName: com.mysql.cj.jdbc.Driver # MySQL的Driver类名
|
||||
username: root # MySQL用户名
|
||||
password: root # MySQL密码
|
||||
jpa:
|
||||
show-sql: true
|
||||
open-in-view: false
|
||||
defer-datasource-initialization: true
|
||||
database-platform: org.hibernate.dialect.MySQL8Dialect # 修改为MySQL的Dialect
|
||||
hibernate:
|
||||
ddl-auto: update # 根据需要调整,update适用于开发和某些生产环境
|
||||
format_sql: true # 保持原样,用于格式化SQL输出
|
||||
|
||||
#
|
||||
#spring:
|
||||
#
|
||||
# jackson:
|
||||
# property-naming-strategy: SNAKE_CASE # 驼峰转下划线
|
||||
#
|
||||
# datasource:
|
||||
# url: jdbc:h2:file:./demo.h2 # 使用文件存储
|
||||
# driverClassName: org.h2.Driver
|
||||
# username: root
|
||||
# password: root
|
||||
# h2:
|
||||
# console: # 开启console访问 默认false
|
||||
# enabled: true
|
||||
# settings:
|
||||
# trace: true # 开启h2 console 跟踪 方便调试 默认 false
|
||||
# web-allow-others: true # 允许console 远程访问 默认false
|
||||
# path: /h2 # h2 访问路径上下文
|
||||
# url: jdbc:mysql://localhost:3306/demo?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true # MySQL连接URL,paopao是数据库名
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver # MySQL的Driver类名
|
||||
# username: root # MySQL用户名
|
||||
# password: root # MySQL密码
|
||||
# jpa:
|
||||
# show-sql: true
|
||||
# open-in-view: false
|
||||
# defer-datasource-initialization: true
|
||||
# database-platform: org.hibernate.dialect.H2Dialect
|
||||
# database-platform: org.hibernate.dialect.MySQL8Dialect # 修改为MySQL的Dialect
|
||||
# hibernate:
|
||||
# ddl-auto: update
|
||||
# ddl-auto: update # 根据需要调整,update适用于开发和某些生产环境
|
||||
# format_sql: true # 保持原样,用于格式化SQL输出
|
||||
|
||||
|
||||
spring:
|
||||
|
||||
jackson:
|
||||
property-naming-strategy: SNAKE_CASE # 驼峰转下划线
|
||||
|
||||
datasource:
|
||||
url: jdbc:h2:file:./db.h2 # 使用文件存储
|
||||
driverClassName: org.h2.Driver
|
||||
username: root
|
||||
password: root
|
||||
h2:
|
||||
console: # 开启console访问 默认false
|
||||
enabled: true
|
||||
settings:
|
||||
trace: true # 开启h2 console 跟踪 方便调试 默认 false
|
||||
web-allow-others: true # 允许console 远程访问 默认false
|
||||
path: /h2 # h2 访问路径上下文
|
||||
jpa:
|
||||
show-sql: true
|
||||
open-in-view: false
|
||||
defer-datasource-initialization: true
|
||||
database-platform: org.hibernate.dialect.H2Dialect
|
||||
hibernate:
|
||||
ddl-auto: update
|
Loading…
Reference in New Issue
Block a user