我有一个带有 JPA 注释的 Java bean/模型类,如下所示。这个类有一个复合键,如下所示。在DAO.java
我如何设置这个复合键的键?
@EmbeddedId
@AttributeOverrides({
@AttributeOverride(name = "ratioFunctionId", column = @Column(name = "ratio_function_id", nullable = false, scale = 0)),
@AttributeOverride(name = "expressionId", column = @Column(name = "expression_id", nullable = false, scale = 0))
})
public RatioFunctionExpressionId getId() {
return this.id;
}
public void setId(RatioFunctionExpressionId id) {
this.id = id;
}