committed by
Zeger Hendrikse
parent
8f01c27090
commit
dd40ed7025
@@ -1,50 +0,0 @@
|
||||
package com.baeldung.graph;
|
||||
|
||||
import org.neo4j.ogm.annotation.GraphId;
|
||||
import org.neo4j.ogm.annotation.NodeEntity;
|
||||
import org.neo4j.ogm.annotation.Relationship;
|
||||
|
||||
/**
|
||||
* @author Danil Kornishev (danil.kornishev@mastercard.com)
|
||||
*/
|
||||
@NodeEntity
|
||||
public class Car {
|
||||
@GraphId
|
||||
private Long id;
|
||||
|
||||
private String make;
|
||||
|
||||
@Relationship(direction = "INCOMING")
|
||||
private Company company;
|
||||
|
||||
public Car(String make, String model) {
|
||||
this.make = make;
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMake() {
|
||||
return make;
|
||||
}
|
||||
|
||||
public void setMake(String make) {
|
||||
this.make = make;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
private String model;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.baeldung.graph;
|
||||
|
||||
import org.neo4j.ogm.annotation.NodeEntity;
|
||||
import org.neo4j.ogm.annotation.Relationship;
|
||||
|
||||
/**
|
||||
* @author Danil Kornishev (danil.kornishev@mastercard.com)
|
||||
*/
|
||||
@NodeEntity
|
||||
public class Company {
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
@Relationship(type="owns")
|
||||
private Car car;
|
||||
|
||||
public Company(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Car getCar() {
|
||||
return car;
|
||||
}
|
||||
|
||||
public void setCar(Car car) {
|
||||
this.car = car;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user