Package net.sf.pmr.core.domain.user.company

Examples of net.sf.pmr.core.domain.user.company.Company


    public final void testUpdateWitConcurrencyFailureException()
            throws Exception {


        // load a company
        Company company1 = (Company) companyMapper.findById(1);
        Company company2 = (Company) companyMapper.findById(1);

        // change name
        company1.setName("blopblop");
        company2.setName("bipbip");

        // update
        companyMapper.addOrUpdate(company1);

        try {
View Full Code Here


    public final void testDeleteWithoutConcurrencyFailureException()
            throws Exception {


        // load a company
        Company company = (Company) companyMapper.findById(2);

        // update
        companyMapper.delete(company);

        // check
View Full Code Here

    public final void testDeleteWithConcurrencyFailureException()
            throws Exception {

        // load a company
        Company company1 = (Company) companyMapper.findById(2);
        Company company2 = (Company) companyMapper.findById(2);

        // update
        companyMapper.delete(company1);

        try {
View Full Code Here

    /**
     * @see net.sf.pmr.core.data.EntityMapper#findById(java.lang.String)
     */
    public final Object findById(final int id) {

        Company company = (Company) getHibernateTemplate().get(
                CompanyImpl.class, new Integer(id));
        if (company != null) {
            company.setAddress(CoreObjectFactory.getAddress());
        }
        return company;

    }
View Full Code Here

    public final List findAll() {

        List list = getHibernateTemplate().loadAll(CompanyImpl.class);

        for (Iterator i = list.iterator(); i.hasNext();) {
            Company company = (Company) i.next();
            company.setAddress(CoreObjectFactory.getAddress());
        }

        return list;

    }
View Full Code Here

            final String streetNumber, final String streetName,
            final String postalCode, final String city, final String country,
            final long persistanceVersion) {

        // get the company to update
        Company company = CoreObjectFactory.getCompany();

        // populate
        company.setId(id);
        company.setName(name);
        company.getAddress().setStreetNumber(streetNumber);
        company.getAddress().setStreetNumber(streetName);
        company.getAddress().setPostalCode(postalCode);
        company.getAddress().setCity(city);
        company.getAddress().setCountry(country);
        company.setPersistanceVersion(persistanceVersion);

        // validate
        Errors errors = companyValidator.validate(company);

        // if no errors are found
View Full Code Here

            final String streetNumber, final String streetName,
            final String postalCode, final String city, final String country,
            final long persistanceVersion) {

        // get the company to update
        Company company = CoreObjectFactory.getCompany();

        // populate
        company.setPersistanceId(id);
        company.setName(name);
        company.getAddress().setStreetNumber(streetNumber);
        company.getAddress().setStreetNumber(streetName);
        company.getAddress().setPostalCode(postalCode);
        company.getAddress().setCity(city);
        company.getAddress().setCountry(country);
        company.setPersistanceVersion(persistanceVersion);

        // validate
        Errors errors = companyValidator.validate(company);

        // if no errors are found
View Full Code Here

TOP

Related Classes of net.sf.pmr.core.domain.user.company.Company

Copyright © 2018 www.massapicom. 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.