Open raycon opened 2 years ago
@Getter
@Setter
@Entity
@NoArgsConstructor
public class Team {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Setter(AccessLevel.NONE)
@Column(nullable = false)
private int id;
private String name;
private String country;
@Builder
public Team(String name, String country) {
this.name = name;
this.country = country;
}
}
When working with JPA and Lombok, remember these rules:
@EqualsAndHashCode
and@Data
with JPA entities@ToString
@NoArgsConstructor
to entities with@Builder
or@AllArgsConstructor
.