about JPA persistence of primary key(多主鍵)
来源:互联网 发布:linux 命令行修改文件 编辑:程序博客网 时间:2024/06/05 01:19
m2m方式时经常遇到的问题,做成多主鍵联合以便定位唯一记录,当使用时在要使用的类中,类声明之前加上如下注释即可.
注释如下:@IdClass(ClassTBPK.class)
联合主鍵写法如下:
package *****;
import java.io.Serializable;
import ***;
@SuppressWarnings("serial")
public class ClassTBPK extends BasePK implements Serializable{
/** ID */
protected String fid;
protected String sid;
/**
* 构造函数
*/
public ClassTBPK(){}
/**
* 构造函数
*/
public ClassTBPK(String first_Id, String second_Id) {
this.fid = first_Id;
this.sid = second_Id;
}
}
- about JPA persistence of primary key(多主鍵)
- about JPA persistence of entity class
- about JPA persistence
- [JavaEE] JPA中的Primary Key的几种生成方式
- PRIMARY KEY
- mysql primary key key
- PRIMARY KEY KEY
- 2.6. About Primary Storage
- JPA-Java Persistence API
- JPA Persistence Unit
- JPA persistence.xml
- jpa persistence.xml 配置
- JPA persistence配置说明
- JPA Oracle persistence.xml
- JPA persistence.xml 文件
- JPA 配置persistence.xml
- JPA-Java Persistence API
- JPA persistence.xml 配置
- 数值相加
- Embroidery Digitizing
- ADO.NET 2.0中的DataSet和DataTable
- adoconnection重新连接问题
- java 单例模式举例
- about JPA persistence of primary key(多主鍵)
- JS图片切换效果
- select组合查询
- 据说这是世界上最美的四十五件事
- uboot1.1.6顶层makefile详解
- 对ASCII文件的操作
- 路面上的坑--系统API的兼容性
- uboot1.1.6顶层mkconfig详解
- 利用绝对定位实现两列右边固定宽度左边自适应布局