根据内容:https://www.ossez.com/t/spring-lombok/14129 修改实体类死循环问题

This commit is contained in:
YuCheng Hu 2022-10-02 19:24:37 -04:00
parent efbefa7902
commit 82161ce5b4
2 changed files with 9 additions and 5 deletions

View File

@ -17,22 +17,23 @@ import java.util.Set;
* @author YuCheng Hu
*/
@Entity
@Getter
@Setter
@Entity
@Accessors(chain = true)
//@Table(name = "person", uniqueConstraints = {@UniqueConstraint(columnNames = "user_name"), @UniqueConstraint(columnNames = "user_email")})
public class Person extends AbstractPersistable<Long> {
@NotBlank
@NotBlank
@Size(max = 20)
private String userName;
@NotBlank
@NotBlank
@Size(max = 120)
private String userPassword;
@NotBlank
@NotBlank
@Email
private String userEmail;

View File

@ -2,12 +2,15 @@ package com.ossez.spring.security.models.entity;
import com.ossez.spring.security.models.ERole;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.jpa.domain.AbstractPersistable;
import javax.persistence.*;
@Entity
@Data
@Getter
@Setter
public class PersonRole extends AbstractPersistable<Long> {
@ManyToOne(fetch = FetchType.LAZY, optional = false)