Examples of BusinessPartner


Examples of com.openbravo.ws.customers.BusinessPartner

    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof BusinessPartner)) {
            return false;
        }
        BusinessPartner other = (BusinessPartner) obj;
        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
                ((this.clientId == null && other.getClientId() == null) ||
                (this.clientId != null &&
                this.clientId.equals(other.getClientId()))) &&
                ((this.complete == null && other.getComplete() == null) ||
                (this.complete != null &&
                this.complete.equals(other.getComplete()))) &&
                ((this.contacts == null && other.getContacts() == null) ||
                (this.contacts != null &&
                java.util.Arrays.equals(this.contacts, other.getContacts()))) &&
                ((this.customer == null && other.getCustomer() == null) ||
                (this.customer != null &&
                this.customer.equals(other.getCustomer()))) &&
                ((this.description == null && other.getDescription() == null) ||
                (this.description != null &&
                this.description.equals(other.getDescription()))) &&
                ((this.id == null && other.getId() == null) ||
                (this.id != null &&
                this.id.equals(other.getId()))) &&
                ((this.locations == null && other.getLocations() == null) ||
                (this.locations != null &&
                java.util.Arrays.equals(this.locations, other.getLocations()))) &&
                ((this.name == null && other.getName() == null) ||
                (this.name != null &&
                this.name.equals(other.getName()))) &&
                ((this.searchKey == null && other.getSearchKey() == null) ||
                (this.searchKey != null &&
                this.searchKey.equals(other.getSearchKey()))) &&
                ((this.vendor == null && other.getVendor() == null) ||
                (this.vendor != null &&
                this.vendor.equals(other.getVendor())));
        __equalsCalc = null;
        return _equals;
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

     *             if an error occurs in the DAO while requesting the database.
     */
    private void applyDiffCBP(ConcreteBusinessPartner cbp, ConcreteBusinessPartnerDTO dto) throws Exception {
        cbp.setId(dto.getId());
        cbp.setAddress(dto.getAddress());
        BusinessPartner bp = businessPartnerDAO.find(dto.getBusinessPartner().getId());
        cbp.setBusinessPartner(bp);
        cbp.setCountry(dto.getCountry());
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

        }

        taa.getParties().clear();
        if (dto.getParties() != null) {
            for (Long bpId : dto.getParties().keySet()) {
                BusinessPartner bp = businessPartnerDAO.find(bpId);
                taa.getParties().add(bp);
            }
        }

        taa.setSignatories(dto.getSignatories());
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

     *             if an error occurs in the DAO while requesting the database.
     */
    private void applyDiffCBP(ConcreteBusinessPartner cbp, ConcreteBusinessPartnerDTO dto) throws Exception {
        // setting null instead of edited id one can perturb, do not set id here. cbp.setId(dto.getId());
        cbp.setAddress(dto.getAddress());
        BusinessPartner bp = businessPartnerDAO.find(dto.getBusinessPartner().getId());
        cbp.setBusinessPartner(bp);
        cbp.setCountry(dto.getCountry());
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

        // Policy : simple and stupid, relaxed, do tolerate some foxes

        // list of result dto... with id inserted.
        List<Long> insertIDs = new ArrayList<Long>();
        for (BusinessPartnerDTO dto : bpList) {
            BusinessPartner bp = bpDAO.find(dto.getId());
            if (bp == null) {
                bp = new BusinessPartner();
                bp.setVersion(1);
            }
            applyDiffBP(bp, dto);
            bp = bpDAO.save(bp);
            insertIDs.add(bp.getId());
        }
        return insertIDs;
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

    @Test
    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFind() throws Exception {
        BusinessPartner bp = bpDAO.find(1L);
        BusinessPartner bpc = new BusinessPartner();

        bpc.setId(1L);
        bpc.setName(UPDATED_BUSINESSPARTNER_NAME);
        bpc.setVersion(2);
        assertNotNull(bp);
        assertEquals(UPDATED_BUSINESSPARTNER_NAME, bp.getName());
        assertEquals(bp, bpc);
        assertSame(2, bp.getVersion());
        assertNull(bpDAO.find(2L));
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFindAll() throws Exception {
        List<BusinessPartner> bps = bpDAO.findAll();
        BusinessPartner bp = new BusinessPartner();

        bp.setId(1L);
        bp.setName(UPDATED_BUSINESSPARTNER_NAME);
        bp.setVersion(2);
        assertSame(1, bps.size());
        assertNotNull(bps.get(0));
        assertEquals(bps.get(0), bp);
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFindEntries() throws Exception {
        List<BusinessPartner> bps = bpDAO.findEntries(0, 1);
        BusinessPartner bp = new BusinessPartner();

        bp.setId(1L);
        bp.setName(UPDATED_BUSINESSPARTNER_NAME);
        bp.setVersion(2);
        assertSame(1, bps.size());
        assertNotNull(bps.get(0));
        assertEquals(bps.get(0), bp);
        bps = bpDAO.findEntries(0, 0);
        assertSame(0, bps.size());
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

    public void testSave() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass()
                    .getResource("/dbunit/dao/admin/businesspartner-create_no-id.xml").openStream());
            BusinessPartner bp = new BusinessPartner();
            BusinessPartner nbp;

            bp.setId(null);
            bp.setName(DEFAULT_BUSINESSPARTNER_NAME);
            bp.setVersion(1);
            nbp = bpDAO.save(bp);
            assertEquals(bp.getName(), nbp.getName());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.BusinessPartner

    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE_ALL)
    public void testSave2() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource(UPDATE_DATASET).openStream());
            BusinessPartner bp = new BusinessPartner();
            BusinessPartner nbp;

            bp.setId(1L);
            bp.setName(UPDATED_BUSINESSPARTNER_NAME);
            bp.setVersion(1);
            nbp = bpDAO.save(bp);
            assertEquals(bp.getName(), nbp.getName());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.