Skip to content

Instantly share code, notes, and snippets.

@odrotbohm
Created April 2, 2012 13:34
Show Gist options
  • Save odrotbohm/2283454 to your computer and use it in GitHub Desktop.
Save odrotbohm/2283454 to your computer and use it in GitHub Desktop.
// Mit @IdClass
@Entity
@IdClass(MyPK.class)
public class MyEntity {
@Id String first;
@Id String second;
}
public class MyPk {
String first;
String second;
// Getter / Setter
}
// Mit @EmbeddedId
@Entity
public class MyEntity {
@EmbeddedId MyPk key;
}
@Embeddable
public class MyPk {
String first;
String second;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment