这是我的xml映射。我需要制作JPA映射
<composite-id>
<key-property name="systemId" type="integer" column="SYSTEM_ID"/>
<key-property name="rollingRackId" type="integer" column="ROLLING_RACK_ID"/>
</composite-id>
<property name="status" type="integer" column="ROLLING_RACK_STATUS"/>
<property name="changeTime" type="timestamp" column="CHANGE_TIME" />
</class>
答案 0 :(得分:1)
您必须引入Id类
@Entity @IdClass(KeyClass.class)
public class Entity{
@Id int systemId;
@Id int rollingRackId;
}
class KeyClass{
int systemId;
int rollingRackId;
}