I have been trying to solve this for whole day but no luck! Also i tried to read most of the tutorials on the net but as you all know they all are full of useless examples t
I know this is very old qs, but for completeness of your case you can just have (jpa 2.0)
@Entity
@Data
public class Vehicle implements Serializable{
@Id
@GeneratedValue
private long vehicleId;
.. //other props
}
@Entity
@Data
public class VehicleExtras implements Serializable{
@Id
@OneToOne (cascade = CASCADE.ALL)
@MapsId
@JoinColumn(name ="vehicleId")
private Vehicle vehicle;
@Column
private boolean allowSmoke;
..// other props.
}
should share same pk/fk for VehicleExtra table