为实体添加Descriptor Customizer后,为什么Jpa / EclipseLink合并实体将其id设置为0?

时间:2016-04-15 07:31:58

标签: java jpa eclipselink

在我激活EclipseLink Descriptor Customizer以跟踪实体更改历史记录后,合并实体将其BigInteger id设置为0.当我停用Customizer类时,一切正常。我在这里做错了什么?

这是我的Customizer类

public class HumanResource_EmployeeCustomizer implements DescriptorCustomizer {

    @Override
    public void customize(ClassDescriptor cd) throws Exception {
        HistoryPolicy policy = new HistoryPolicy();
        policy.addStartFieldName("START");
        policy.addEndFieldName("END");
        policy.addHistoryTableName("EMPLOYEE", "HUMANRESOURCE_EMPLOYEE_");
        cd.setHistoryPolicy(policy);
    }
}

entity id before commit

entity id after commit

0 个答案:

没有答案