lundi 24 août 2015

Openpojo businessException when reference to other pojo

I'm trying to test pojo classess using openpojo but i have the same error like there. I don't understand that solution so I'll ask again. What should I do to proper using @BusinessKey.

My classes:

public class Person {
    @BusinessKey
    private Integer id;

...getters/setters

    @Override
    public boolean equals(Object obj) {
        return BusinessIdentity.areEqual(this, obj);
    }

    @Override
    public int hashCode() {
        return BusinessIdentity.getHashCode(this);
    }
} 


public class Employee {
    @BusinessKey
    private Integer id;

    private Person person;

    ...getters/setters

    @Override
    public boolean equals(Object obj) {
        return BusinessIdentity.areEqual(this, obj);
    }

    @Override
    public int hashCode() {
        return BusinessIdentity.getHashCode(this);
    }
}

Aucun commentaire:

Enregistrer un commentaire