New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing property value to null does not cause seting changed_properties column #213

Closed
floresek opened this Issue Sep 29, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@floresek

floresek commented Sep 29, 2015

Hi,

Suppose class:

class SimpleTypes {
    @Id
    String id;

    enum TestEnum { ONE, TWO }

    Date date = new Date();
    Timestamp ts = new Timestamp(date.getTime());
    String text = "test";
    Boolean bool = true;
    Long longNumber = 1l;
    Integer integerNumber = 1;
    Short shortNumber = 1;
    Double doubleNumber = 1.0;
    Float floatNumber = 1.0f;
    BigDecimal bigDecimalNumber = BigDecimal.ONE;
    byte byteFiled = 0x1;
    TestEnum testEnum = TestEnum.ONE;

    public SimpleTypes(String id) {
        this.id = id;
    }

    public void nullify() {
        date = null;
        ts = null;
        text = null;
        bool = null;
        longNumber = null;
        integerNumber = null;
        shortNumber = null;
        doubleNumber = null;
        floatNumber = null;
        bigDecimalNumber = null;
        testEnum = null;
    }
}

If I executed following code:

        SimpleTypes obj = new SimpleTypes("2");
        javers.commit("anonymous", obj);
        obj.nullify();
        javers.commit("anonymous", obj);

I noticed that snapshot of second commit has '[]' value in changed_properties column - but should have all nullified properties names.

Cheers
Mariusz

@bartoszwalacik bartoszwalacik added the bug label Sep 30, 2015

bartoszwalacik added a commit that referenced this issue Sep 30, 2015

bartoszwalacik added a commit that referenced this issue Sep 30, 2015

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Oct 1, 2015

fixed in v 1.3.11 released right now

@floresek

This comment has been minimized.

floresek commented Oct 1, 2015

Thanks for quick fix ;)

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Oct 1, 2015

thanx for clear bug report :)

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Oct 1, 2015

dont forget to give us a star https://github.com/javers/javers/stargazers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment