ignorejson
This commit is contained in:
snoop 2016-11-17 19:13:52 +09:00
parent cd5464a5cf
commit 14cdf606cd
8 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryhost; package com.loafle.bridge.discoveryhost;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loafle.bridge.discoveryport.DiscoveryPort; import com.loafle.bridge.discoveryport.DiscoveryPort;
import com.loafle.bridge.discoveryzone.DiscoveryZone; import com.loafle.bridge.discoveryzone.DiscoveryZone;
@ -25,6 +26,7 @@ public class DiscoveryHost {
@ManyToOne @ManyToOne
@JoinColumn(name = "ZONE_ID", nullable = false) @JoinColumn(name = "ZONE_ID", nullable = false)
@JsonIgnore
private DiscoveryZone zone; private DiscoveryZone zone;
public DiscoveryZone getZone() { public DiscoveryZone getZone() {

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryhost; package com.loafle.bridge.discoveryhost;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loafle.bridge.discoveryport.type.DirectionType; import com.loafle.bridge.discoveryport.type.DirectionType;
import com.loafle.bridge.discoveryport.type.PortType; import com.loafle.bridge.discoveryport.type.PortType;
@ -18,6 +19,7 @@ public class PortScanHistory {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn @JoinColumn
@JsonIgnore
private DiscoveryHost host; private DiscoveryHost host;
public DiscoveryHost getHost() { public DiscoveryHost getHost() {

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryport; package com.loafle.bridge.discoveryport;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loafle.bridge.discoveryhost.DiscoveryHost; import com.loafle.bridge.discoveryhost.DiscoveryHost;
import com.loafle.bridge.discoveryport.type.PortType; import com.loafle.bridge.discoveryport.type.PortType;
import com.loafle.bridge.discoveryservice.DiscoveryService; import com.loafle.bridge.discoveryservice.DiscoveryService;
@ -17,6 +18,7 @@ public class DiscoveryPort {
@ManyToOne @ManyToOne
@JoinColumn @JoinColumn
@JsonIgnore
private DiscoveryHost host; private DiscoveryHost host;
public DiscoveryHost getHost() { public DiscoveryHost getHost() {
return host; return host;

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryport; package com.loafle.bridge.discoveryport;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loafle.bridge.discoveryport.type.DirectionType; import com.loafle.bridge.discoveryport.type.DirectionType;
import javax.persistence.*; import javax.persistence.*;
@ -22,6 +23,7 @@ public class ServiceScanHistory {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn @JoinColumn
@JsonIgnore
private DiscoveryPort port; private DiscoveryPort port;

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryservice; package com.loafle.bridge.discoveryservice;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loafle.bridge.discoveryport.DiscoveryPort; import com.loafle.bridge.discoveryport.DiscoveryPort;
import com.loafle.bridge.discoveryport.type.PortType; import com.loafle.bridge.discoveryport.type.PortType;
@ -17,6 +18,7 @@ public class DiscoveryService {
@ManyToOne @ManyToOne
@JoinColumn(nullable = false) @JoinColumn(nullable = false)
@JsonIgnore
private DiscoveryPort port; private DiscoveryPort port;
public DiscoveryPort getPort() { public DiscoveryPort getPort() {
return port; return port;

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryzone; package com.loafle.bridge.discoveryzone;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.loafle.bridge.discoveryhistory.DiscoveryHistory; import com.loafle.bridge.discoveryhistory.DiscoveryHistory;
import com.loafle.bridge.discoveryhost.DiscoveryHost; import com.loafle.bridge.discoveryhost.DiscoveryHost;
@ -25,6 +26,7 @@ public class DiscoveryZone {
@JoinColumn @JoinColumn
@OneToOne @OneToOne
@JsonIgnore
private DiscoveryHistory discovery; private DiscoveryHistory discovery;
@OneToMany(mappedBy = "zone", cascade = CascadeType.ALL) @OneToMany(mappedBy = "zone", cascade = CascadeType.ALL)

View File

@ -1,5 +1,8 @@
package com.loafle.bridge.discoveryzone; package com.loafle.bridge.discoveryzone;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
@ -33,8 +36,9 @@ public class HostScanHistory {
@Column @Column
private String description; private String description;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn @JoinColumn
@JsonIgnore
private DiscoveryZone zone; private DiscoveryZone zone;
public long getId() { public long getId() {

View File

@ -10,7 +10,7 @@ spring.datasource.driver-class-name=org.h2.Driver
## Hibernate configuration ## Hibernate configuration
spring.jpa.database=h2 spring.jpa.database=h2
spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.hibernate.ddl-auto=create
#spring.jpa.hibernate.ddl-auto=update #spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.show-sql=true spring.jpa.show-sql=true