Skip to content

Instantly share code, notes, and snippets.

@nemo83
Created March 30, 2013 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemo83/5276318 to your computer and use it in GitHub Desktop.
Save nemo83/5276318 to your computer and use it in GitHub Desktop.
@Entity
@Table(name="PROJ_EMP")
@IdClass(ProjectAssociationId.class)
public class ProjectAssociation {
@Id
private long employeeId;
@Id
private long projectId;
@Column("IS_PROJECT_LEAD")
private boolean isProjectLead;
@ManyToOne
@PrimaryKeyJoinColumn(name="EMPLOYEEID", referencedColumnName="ID")
private Employee employee;
@ManyToOne
@PrimaryKeyJoinColumn(name="PROJECTID", referencedColumnName="ID")
private Project project;
//[...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment