Package framework.beans.address.entities

Examples of framework.beans.address.entities.AddressObjectType


     * @throws generic.ClipsServerException
     */
    private boolean fillEntity(AddressItem item,
                            AddressObject parent) throws ClipsServerException{

        AddressObjectType type = findAddressObjectType(item.item.typeId);
//        if ((item.entity.getParent() != null)
//                && (item.entity.getParent().getKladrCode().equals(item.entity.getKladrCode()))){
//            System.out.println("FUCKING 498: "+ item);
//        }
        if (type == null){
View Full Code Here


        return UserRightsSetAbstract.WRITE_REGION_ADMIN_DIRECTORY;
    }

    @Override
    protected void set(AddressObjectType entity, AddressObjectTypeDetails details) {
        AddressObjectType aot = entity;
        AddressObjectTypeDetails d = details;
        aot.setTitle(details.title);
        aot.setAbbrivation(d.abbrivation);
        aot.setIsVillage(d.isVillage);
        aot.setLevel(d.level);
        aot.setCode(d.code);
        aot.setExtKey(d.external_key);
    }
View Full Code Here

        Field[] f = new Field[] {new Field("code", codes2update, Field.OPERATOR_IN)};
        //выберем уже лежащие в базе сущности
        Iterator it = findEntityList(AddressObjectType.class, f).iterator();
        //и загоним их в мап
        while (it.hasNext()) {
            AddressObjectType type = (AddressObjectType)it.next();
            entitys2Update.put(type.getCode(), type);
        }

        //теперь добавляем сущности в базу (существующие обновим взяв из мапа)
        for (AddressObjectTypeDetails d : types) {
            AddressObjectType type = entitys2Update.get(d.code);
            if (type == null){
                type = new AddressObjectType();
                type.setAbbrivation(d.abbrivation);
                type.setCode(d.code);
                type.setLevel(d.level);
                type.setTitle(d.title);
                manager.persist(type);
            }else{
                type.setAbbrivation(d.abbrivation);
                type.setCode(d.code);
                type.setLevel(d.level);
                type.setTitle(d.title);
                manager.merge(type);
            }
        }
        manager.flush();
    }
View Full Code Here

TOP

Related Classes of framework.beans.address.entities.AddressObjectType

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.