ObjectDB ObjectDB

Entity field renaming does not work



we use the ObjectDB version 2.8.5_05.

We want to rename a field in an entity and it does not work:


package com.btc.ep.analysis.verdict.tolerance.bl.internal.dmos;


@Access (AccessType.FIELD)
public class ToleranceDeviationImpl {
    private String referenceDatatype;
    private String comparisonDatatype;


    private String referenceDisplayDataTypeName;
    private String comparisonDisplayDataTypeName;

We added the schema for renaming to the objectdb config:


        <package name="com.btc.ep.atg4struct.bl.internal.dmos">
            <class name="CoveragePropertyToBoolObserverImpl" new-name="com.btc.ep.atg4struct.internal.dmos.CoveragePropertyToBoolObserverImpl" />
        <package name="com.btc.ep.formalverification.al.enums">
            <class name="ResultExpectationEnum" new-name="com.btc.ep.formalverification.enums.ResultExpectationEnum" />
        <package name="com.btc.ep.formalverification.bl.dmos">
            <class name="ProofResult" new-name="com.btc.ep.formalverification.internal.dmos.ProofResult" />
            <class name="ProofResult$Result" new-name="com.btc.ep.formalverification.internal.dmos.ProofResult$Result" />
            <class name="ProofResult$TerminationReason" new-name="com.btc.ep.formalverification.internal.dmos.ProofResult$TerminationReason" />
        <package name="com.btc.ep.formalverification.bl.internal.dmos">
            <class name="ProofSettingsImpl" new-name="com.btc.ep.formalverification.internal.dmos.ProofSettingsImpl" />                      
            <class name="ProofResultImpl" new-name="com.btc.ep.formalverification.internal.dmos.ProofResultImpl" />
            <class name="ProofImpl" new-name="com.btc.ep.formalverification.internal.dmos.ProofImpl" />
        <package name="com.btc.ep.analysis.verdict.tolerance.bl.internal.dmos">
            <class name="ToleranceDeviationImpl">
                <field name="referenceDatatype" new-name="referenceDisplayDataTypeName" />
                <field name="comparisonDatatype" new-name="comparisonDisplayDataTypeName" />


We have also class and package renaming for other entities and it works correctly.


Thank you for this report, we are investigating the issue.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Unfortunately we cannot reproduce the issue, as we checked and this feature seems to work well in our small tests (and also the relevant code in ObjectDB has not been changed recently).

Please note that supporting field renaming is very sensitive. There is nothing wrong with your code or configuration as posted above. However, for this to work the timing is very important. On the first time that the database is opened with the schema change specified in the configuration file, only the class after the change has to be available on the classpath. Otherwise the upgrade will fail. Could you please confirm that this is the case?

As we cannot reproduce the issue, to explore it further we will need your help. Could you please post (possibly in a private support ticket) a sample test database before the schema change, up to date classes (no source code is needed) with the new field names and your ObjectDB configuration file?

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

I created a private ticket:


Thank you for the provided the test case, which indeed demonstrates an issue with field renaming schema upgrade (old schema versions of the class, if exist, missed the upgrade).
Please try build 2.6.8_08 that should fix this issue.
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

The fix works well.

Thank you very much.

Post Reply