Last active
December 16, 2015 06:29
-
-
Save sebersole/5391925 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Entity | |
| @Table(name = "ACTIVITY") | |
| @Audited | |
| public class Activity implements Serializable { | |
| @Id | |
| @Column(name = "Id") | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| private long id; | |
| @ManyToOne | |
| @JoinTable( | |
| name="ACTIVITYPROFILE_ACTIVITY", | |
| joinColumns = @JoinColumn(name="ACTIVITY_ID", referencedColumnName="ID"), | |
| inverseJoinColumns = @JoinColumn(name="ACTIVITYPROFILE_ID", referencedColumnName="ID") | |
| ) | |
| private ActivityProfile activityProfile; | |
| ... | |
| } | |
| @Entity | |
| @Table(name = "ACTIVITYPROFILE") | |
| public class ActivityProfile { | |
| @Id | |
| @Column(name = "ActivityProfileId") | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| private Long id; | |
| @OneToMany(mappedBy="activityProfile", cascade = { CascadeType.ALL }) | |
| private List<Activity> activities; | |
| ... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment