Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Error al cargar bean en un grid

jorge marquez
6 years ago Jan 07, 2016 8:21pm
jorge marquez
6 years ago Jan 18, 2016 4:09pm

bueno he solucionado el problema implementando los metodos hascode() y equals()  en el bean asociado

public int hashCode() {
        // TODO Auto-generated method stub
        HashCodeBuilder hcb = new HashCodeBuilder();
        hcb.append(comCreatedDate);
        hcb.append(comLatitude);
        hcb.append(comLongitude);
        hcb.append(comName);
        hcb.append(comOwnerCompanyId);
        hcb.append(comState);
    
        return hcb.toHashCode();
    }
    @Override
    public boolean equals(Object obj) {
        // TODO Auto-generated method stub
        if(this==obj)
            return true;
        if(!(obj instanceof Company))
            return false;
        Company that = (Company)obj;
        EqualsBuilder eb = new EqualsBuilder();
        eb.append(comLatitude, that.comLatitude);
        eb.append(comLongitude, that.comLongitude);
        eb.append(comState, that.comState);
        eb.append(comCreatedDate, that.comCreatedDate);
        eb.append(comName, that.comName);
        eb.append(comOwnerCompanyId, that.comOwnerCompanyId);

        return eb.isEquals();
    }