-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
WARNING 1
@DaTa annotation should not be used with @entity annotation. There is a warning came from IDEA ,Using @Data for JPA entities is not recommended. It can cause severe performance and memory consumption issues.
@Entity
@Data
public class ToDo {
...
}BUG 1
These two annotations, @GeneratedValue, and @GenericGenerator, do not work here. Therefore, The @NoArgsContructor
annotation will not offer any convenience for a clean code. You must have a no-args-contructor to initiate an instance including field and field.
@NotNull
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
private String id;CONCLUSION
还需要进一步了解几个关键的注解,有@NoArgsContructor, @RequiredArgsContructor, @GeneratorValue, @GenericGenerator
Metadata
Metadata
Assignees
Labels
No labels