Car

Car.java
01package com.db4odoc.commitcallbacks; 02 03public class Car { 04 05 private String name; 06 07 private int model; 08 09 private Pilot pilot; 10 11 public Car(String name, int model, Pilot pilot) { 12 this.name = name; 13 this.model = model; 14 this.pilot = pilot; 15 } 16 17 public void setModel(int model) { 18 this.model = model; 19 } 20 21 public void setPilot(Pilot pilot) { 22 this.pilot = pilot; 23 } 24 25 public String toString() { 26 return "Car: " + name + " " + model + " Pilot: " + pilot.getName(); 27 } 28}
Pilot.java
01package com.db4odoc.commitcallbacks; 02 03public class Pilot { 04 05 private String name; 06 07 public String getName() { 08 return name; 09 } 10 11 public Pilot(String name) { 12 this.name = name; 13 } 14}