@Entity
public class Car {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany(mappedBy = "car", cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
private Set<Feature> features = new HashSet<>();
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private CarFactory carFactory;
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private Info info;
}