package ttu.tteh.user;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

import lombok.Getter;
import lombok.Setter;

@Entity
@Getter
@Setter
public class User {
	@Id
	@GeneratedValue
	long id;
	String firstName;
	String lastName;
	int numOfPets;
	@OneToOne()
	Car car;
}

@@ -17,16 +17,54 @@
 .user;%0A%0A
+import javax.persistence.CascadeType;%0A
 import j
@@ -379,16 +379,39 @@
 neToOne(
+cascade=CascadeType.ALL
 )%0A%09Car c

Save related objects automatically using CascadeType