Code:
public class Vehicle {
private Long id;
private VehicleType type;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id= id;
}
public VehichleType getVehicleType() {
return this.type;
}
public void setVehicleType(VehicleType vType) {
this.type = vType;
}
}
public class VehicleType {
private Long id;
private String description;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id= id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description= description;
}
The only this special on the mapping is on the Vehicle Mapping
Vehicle.hbm.xml
...
<many-to-one name="type" column="VEHICLE_TP_ID"/>