【问题标题】:MySQL: Insert into ListMySQL:插入列表
【发布时间】:2020-11-09 13:46:40
【问题描述】:

我的用户实体中有一个列表属性。当我添加测试用户时,当我想向这个用户的列表中添加一些东西时,我得到一个空指针异常(因为列表中还没有值)。如果我在创建用户时添加了一个blob,由于密码错误,登录不起作用

 INSERT INTO user_entity (id, last_name, first_name, email,
 telephone_number, password, country, Role, Status, version, want_information) VALUES
 (10, 'Datenschutz', 'Dieter', 'datenschutzbeauftrager@company.com', '01766666666',
'$2a$10$Sr6SDXQxBGi0hurRhz9Z8eTubESH.xYU6H2zD8c/ytAvoIqSowH5y',
'Deutschland',1,0,0, false);

【问题讨论】:

标签: mysql sql spring spring-boot jpa


【解决方案1】:

根据错误的密码。我假设您使用 Spring Security。默认情况下,Spring 使用 Bcrypt 加密密码,因此密码应存储为:{bcrypt}encrypted_password。 出于开发目的,您可以使用this generator

【讨论】:

  • 但只有当我在contact_persons列中插入一个blob时密码才无效。如果该列为空/null,则密码有效
猜你喜欢
  • 2012-05-08
  • 2013-03-26
  • 1970-01-01
  • 2021-01-05
  • 2013-04-19
  • 1970-01-01
  • 2021-09-15
  • 2010-11-21
  • 2017-09-28
相关资源
最近更新 更多