Created
April 2, 2012 13:34
-
-
Save odrotbohm/2283454 to your computer and use it in GitHub Desktop.
This file contains 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
// 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