Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active June 30, 2017 11:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save iyengarajay/fc2c49f598d17fcbe44717b9f8c429f8 to your computer and use it in GitHub Desktop.
@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