我的复合主键是由2个字段组成的,现在能拿到其中一个字段的值,不知道如何拿到另一个值?小弟诚请各位高手解决,online等!谢谢了
上面的发错了,
用JDBC和hibernate都可以直接查询,返回的有可能是多条记录。
JDBC:
[code="sql"]select id_a from table1 where id_b[/code]
hibernate: 一般复合主键映射成一个实体对象
如:
[code="java"]
public class Table1 {
private TableId id;
private String xxxProperty1;
private String xxxProperty2;
}
public class TableId {
private String id_a;
private String id_b;
}
[/code]
[code="hql"]from Table1 t where t.id.id_b=?[/code]
装sdk前还要安装JDK,并设置环境变量。