gpt4 book ai didi

java - Lombok 与 hibernate

转载 作者:IT老高 更新时间:2023-10-28 21:14:42 24 4
gpt4 key购买 nike

这可能吗?没有看到太多关于它的讨论。

最佳答案

当然!根据我的经验,它非常有效。这是一个示例实体:

@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class PingerEntity {
// ID
@Id
@Getter
@Setter
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;


// USER
@Getter
@Setter
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private UserEntity user;


// URL
@Getter
@Setter
@Basic(optional = false)
private String url;


/**
* The number of seconds between checks
*/
@Getter
@Setter
@Basic(optional = false)
private int frequency;


@Getter
@Setter
@Basic(optional = false)
@Enumerated(EnumType.STRING)
public MonitorType monitorType;
}

关于java - Lombok 与 hibernate ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4866706/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com