[alerter,common]fixbug告警定义关联监控不存在时异常

This commit is contained in:
tomsun28
2022-02-19 15:02:12 +08:00
parent e6d0540813
commit 9c38da871a
2 changed files with 5 additions and 0 deletions

View File

@@ -7,6 +7,8 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -58,5 +60,6 @@ public class AlertDefineMonitorBind {
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "monitor_id", referencedColumnName = "id", insertable = false, updatable = false)
@NotFound(action = NotFoundAction.IGNORE)
private Monitor monitor;
}