首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

JPA配备左连接

2012-11-14 
JPA配置左连接model层:?@Id?@GeneratedValue(strategy GenerationType.IDENTITY)?private Integer id???

JPA配置左连接

model层:

?@Id
?@GeneratedValue(strategy = GenerationType.IDENTITY)
?private Integer id???????? ;??????
?private Integer client_type;??????
???????????????????????????????????
?private String versionid?? ;??????
?private String down_url??? ;??????
???????????????????????????????????
?private Timestamp addtime? ;
? @ManyToOne
? @JoinColumn(name="client_type",updatable = false,insertable = false)
??? private CntvClientServer cntvClientServer;
?

?
?@Transient
?private String servername;//临时字符串?

?

?public CntvSoftVersion(){}
?
?public CntvSoftVersion(CntvSoftVersion cn,String servername){
??super();
??this.id=cn.getId();
??this.client_type=cn.getClient_type();
??this.versionid=cn.getVersionid();
??this.down_url=cn.getDown_url();
??this.addtime=cn.getAddtime();
??
??this.servername=servername;?
?
??
?}

dto层:

StringBuffer hql_sb = new StringBuffer(" select new CntvSoftVersion(a,b.servername) from CntvSoftVersion a left join a.cntvClientServer b? where 1=1 ");

热点排行