package refacrot

This commit is contained in:
geek 2016-11-17 11:14:20 +09:00
parent e614bb1b86
commit f56eb5e612
6 changed files with 32 additions and 28 deletions

View File

@ -1,4 +1,7 @@
package com.loafle.bridge.discoveryhost.entity;
package com.loafle.bridge.discoveryhost;
import com.loafle.bridge.discoveryport.DiscoveryPort;
import com.loafle.bridge.discoveryzone.DiscoveryZone;
import javax.persistence.*;
import java.util.Date;
@ -20,17 +23,17 @@ public class DiscoveryHost {
@Column(name = "MAC_ADDRESS",nullable = false)
private long macAddress;
// @ManyToOne
// @JoinColumn(name = "ZONE_ID", nullable = false)
// private DiscoveryZone zone;
@ManyToOne
@JoinColumn(name = "ZONE_ID", nullable = false)
private DiscoveryZone zone;
// public DiscoveryZone getZone() {
// return zone;
// }
//
// public void setZone(DiscoveryZone zone) {
// this.zone = zone;
// }
public DiscoveryZone getZone() {
return zone;
}
public void setZone(DiscoveryZone zone) {
this.zone = zone;
}
@OneToMany(mappedBy = "host")
private List<PortScanHistory> histories;
@ -43,16 +46,16 @@ public class DiscoveryHost {
this.histories = histories;
}
// @OneToMany(mappedBy = "host")
// private List<DiscoveryPort> ports;
//
// public List<DiscoveryPort> getPorts() {
// return ports;
// }
//
// public void setPorts(List<DiscoveryPort> ports) {
// this.ports = ports;
// }
@OneToMany(mappedBy = "host")
private List<DiscoveryPort> ports;
public List<DiscoveryPort> getPorts() {
return ports;
}
public void setPorts(List<DiscoveryPort> ports) {
this.ports = ports;
}
@Column(name = "CREATE_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false)
private Date createDate;

View File

@ -1,4 +1,4 @@
package com.loafle.bridge.discoveryhost.controller;
package com.loafle.bridge.discoveryhost;
/**
* Created by root on 16. 11. 15.

View File

@ -1,6 +1,6 @@
package com.loafle.bridge.discoveryhost.repository;
package com.loafle.bridge.discoveryhost;
import com.loafle.bridge.discoveryhost.entity.DiscoveryHost;
import com.loafle.bridge.discoveryhost.DiscoveryHost;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@ -1,4 +1,4 @@
package com.loafle.bridge.discoveryhost.entity;
package com.loafle.bridge.discoveryhost;
import com.loafle.bridge.discoveryport.type.DirectionType;
import com.loafle.bridge.discoveryport.type.PortType;

View File

@ -1,6 +1,6 @@
package com.loafle.bridge.discoveryport;
import com.loafle.bridge.discoveryhost.entity.DiscoveryHost;
import com.loafle.bridge.discoveryhost.DiscoveryHost;
import com.loafle.bridge.discoveryport.type.PortType;
import com.loafle.bridge.discoveryservice.DiscoveryService;

View File

@ -1,8 +1,9 @@
package com.loafle.bridge.discoveryhost.repository;
import com.loafle.bridge.Application;
import com.loafle.bridge.discoveryhost.entity.DiscoveryHost;
import com.loafle.bridge.discoveryhost.entity.PortScanHistory;
import com.loafle.bridge.discoveryhost.DiscoveryHost;
import com.loafle.bridge.discoveryhost.DiscoveryHostRepository;
import com.loafle.bridge.discoveryhost.PortScanHistory;
import com.loafle.bridge.discoveryport.type.DirectionType;
import com.loafle.bridge.discoveryport.type.PortType;
import org.apache.log4j.Logger;