raycon / til

Today I Learned
MIT License
16 stars 3 forks source link

Jpa + Lombok #95

Open raycon opened 2 years ago

raycon commented 2 years ago

When working with JPA and Lombok, remember these rules:

https://dzone.com/articles/lombok-and-jpa-what-may-go-wrong

raycon commented 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;
  }

}