Skip to content

Instantly share code, notes, and snippets.

@sebersole
Last active December 16, 2015 01:39
Show Gist options
  • Save sebersole/5357195 to your computer and use it in GitHub Desktop.
Save sebersole/5357195 to your computer and use it in GitHub Desktop.
"many-to-many" with association entity using annotations
@Entity
public class Membership implements IMembership {
@EmbeddedId
private MembershipKey id;
}
@Embeddable
public final class MembershipKey implements IMembershipKey, Serializable {
@ManyToOne
private User user;
@ManyToOne
private Grid grid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment