hibernate联合主键

@Entity
@Table(name = "TABLE_NAME")
@IdClass(PK.class)
public class TableName implements Serializable{
@Id
@Column(name="ID1")
private String id1;
@Id
@Column(name="ID2")
private String id2;
@Column(name="OTHER")
private String other; public class PK implements Serializable {
private String id1;
private String id2;
}
上一篇:hibernate联合主键 注解方式


下一篇:hibernate联合主键注解配置