Package beans.directory.service.entity

Examples of beans.directory.service.entity.ServiceToService


        }
       
        Iterator list = findEntityList(ServiceToService.class, "pservice.id", pserviceId).iterator();
        ArrayList<ServiceToServiceDetails> res = new ArrayList<ServiceToServiceDetails>();
        while(list.hasNext()) {
            ServiceToService sts = (ServiceToService)list.next();
            res.add(sts.getDetails((RightChecker) this));
        }
       
        return res;
    }
View Full Code Here


       
        Field f[] = {
            new Field("key.pservice", pserviceId),
            new Field("key.cservice", details.cserviceId)
        };
        ServiceToService sts = (ServiceToService) findEntityList(ServiceToService.class, f).get(0);
        manager.remove(sts);
    }
View Full Code Here

       
        if(pserviceId == 0) {
            throw new EDataIntegrity("Попытка назначить связанную услугу услуге с ID=0");
        }
       
        ServiceToService serviceToService = null;
        if(details.pserviceId != 0) {
            Field f[] = {
                new Field("key.pservice", pserviceId),
                new Field("key.cservice", details.cserviceId)
            };
            List list = findEntityList(ServiceToService.class, f);
            if (!list.isEmpty()){
                serviceToService = (ServiceToService) list.get(0);//Должна быть одна
                serviceToService.setDescription(details.description);
                serviceToService.setObligatory(details.obligatory);
            }
            else {
                serviceToService = new ServiceToService();
                serviceToService.setKey(new ServiceToServicePK(pserviceId, details.cserviceId));
                serviceToService.setDescription(details.description);
                serviceToService.setObligatory(details.obligatory);
                serviceToService.setParentService(findEntity(Service.class, details.pserviceId));
                serviceToService.setChildService(findEntity(Service.class, details.cserviceId));
            }
        }          
        return saveEntity(serviceToService);
    }
View Full Code Here

TOP

Related Classes of beans.directory.service.entity.ServiceToService

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.