Package org.internna.iwebmvc.model

Examples of org.internna.iwebmvc.model.AddressType


    public void testParse() {
        assertNull(addressParser.parse(null));
        Address address = new Address();
        address.setProvince(new Province());
        address.getProvince().setId(baseDao.first(Province.class).getId());
        address.setType(new AddressType());
        address.getType().setId(baseDao.first(AddressType.class).getId());
        address = addressParser.parse(address);
        assertNotNull(address.getProvince().getCountry());
        assertNotNull(address.getType().getType());
        address = new Address();
View Full Code Here


                parsed = getDao().find(Address.class, address.getId());
                BeanUtils.copyProperties(address, parsed, new String[] {"id"});
            }
            Province province = address.getProvince();
            if ((province != null) && (province.getId() != null)) address.setProvince(getDao().find(Province.class, province.getId()));
            AddressType type = address.getType();
            if ((type != null) && (type.getId() != null)) address.setType(getDao().find(AddressType.class, type.getId()));
        }
        return parsed;
    }
View Full Code Here

            if (logger.isInfoEnabled()) logger.info("AddressType table is empty. Generating data...");
            Properties allTypes = addressTypes.entrySet().iterator().next().getValue();
            for (String code : allTypes.stringPropertyNames()) {
                if (logger.isDebugEnabled()) logger.debug("Creating address type [" + code + "]");
                try {
                    AddressType type = new AddressType();
                    type.setType(new I18nText());
                    for (Locale locale : addressTypes.keySet())
                      type.getType().add(locale, addressTypes.get(locale).getProperty(code));
                    dao.create(type);
                } catch (Exception ex) {
                    if (logger.isDebugEnabled()) logger.debug("Address type [" + code + "] could not be saved: " + ex.getMessage());
                }
            }
View Full Code Here

TOP

Related Classes of org.internna.iwebmvc.model.AddressType

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.