Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active June 30, 2017 11:23
Embed
What would you like to do?
@Entity
public class SocialMediaSite {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String description;
@OneToMany(mappedBy = "socialMediaSite", cascade = CascadeType.ALL, orphanRemoval = true)
private List<User> users = new ArrayList<>();
//Other details.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment