From 97edca8f0e3bdb292babb9a75067a8c7c116d2a2 Mon Sep 17 00:00:00 2001 From: insanity Date: Mon, 21 Aug 2017 14:53:14 +0900 Subject: [PATCH] Probe-Host mapping entity --- .../module/probe/model/ProbeHost.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/com/loafle/overflow/module/probe/model/ProbeHost.java diff --git a/src/main/java/com/loafle/overflow/module/probe/model/ProbeHost.java b/src/main/java/com/loafle/overflow/module/probe/model/ProbeHost.java new file mode 100644 index 0000000..a9e5777 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/probe/model/ProbeHost.java @@ -0,0 +1,48 @@ +package com.loafle.overflow.module.probe.model; + +import com.loafle.overflow.module.infra.model.InfraHost; + +import javax.persistence.*; + +/** + * Created by insanity on 17. 8. 21. + */ + +@Entity +@Table(name = "PROBE_INFRAHOST", schema = "public", catalog = "postgres") +public class ProbeHost { + + private long id; + private Probe probe; + private InfraHost host; + + @Id + @GeneratedValue(strategy= GenerationType.IDENTITY) + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @OneToOne + @JoinColumn(name = "PROBE_ID", nullable = false) + public Probe getProbe() { + return probe; + } + + public void setProbe(Probe probe) { + this.probe = probe; + } + + @OneToOne + @JoinColumn(name = "HOST_ID", nullable = false) + public InfraHost getHost() { + return host; + } + + public void setHost(InfraHost infraHost) { + this.host = infraHost; + } +}