Package beans.user.job.entity

Examples of beans.user.job.entity.Job


       
        List jobs = findEntityList(Job.class, "client", entity, "ORDER BY a.begin");
        List<JobDetails> res = new ArrayList<JobDetails>();
        Iterator i = jobs.iterator();
        while (i.hasNext()) {
            Job j = (Job) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here


        Client entity = getExistentEntity();
        List jobs = findEntityList(Job.class, "client", entity, " AND a.end IS NULL ORDER BY a.begin DESC");
        if (jobs.isEmpty()) {
            return null;
        }
        Job job = (Job) jobs.get(0);
        return job.getDetails(this);
    }
View Full Code Here

    }
   
    @Override
    public ModificationInfo addDanger(DangerJobDetails details) throws ClipsServerException{
        checkCommandAccessibility(COMMAND_MODIFY);
        Job entity = getExistentEntity();
       
        int jobId = entity.getId();
        if (details.jobId != 0 && jobId != details.jobId){
            throw new EDataIntegrity("Запрещено подменять работу опасному фактору! job(entity): "+jobId + " job(details): " +  details.jobId);
        }
        Field f[] = {
            new Field("key.job", jobId),
View Full Code Here

    }

    @Override
    public Set<DangerJobDetails> getDangerList() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        Job entity = getExistentEntity();
       
        int jobId = entity.getId();
        if (jobId == 0) {
            throw new EDataIntegrity("");
        }

        Iterator list = findEntityList(DangerJob.class, "key.job", jobId).iterator();
View Full Code Here


    @Override
    public ModificationInfo removeDanger(DangerJobDetails details) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_REMOVE);
        Job entity = getExistentEntity();
       
        int jobId = entity.getId();
        if (jobId != details.jobId){
            throw new EDataIntegrity("Вредный фактор относится к другой работе. Удаление невозможно!");
        }
       
        checkEntityExist();
View Full Code Here

        //МЕСТО РАБОТЫ И ДОЛЖНОСТЬ
        if (!c.job.isEmpty()) {
            Field f1[] = { new Field("client", client) };
            List<Job> jobList = findEntityList(Job.class, f1);
            Job job = null;
            for (Job item : jobList) {
                if (item.getEnterprise().getTitle().equals(c.job)) {
                    job = item;
                    break;
                }
            }
            if (job == null) {
                //Создание новой работы, возможно с созданием нового предприятия
                Field f2[] = { new Field("title", c.job) };
                List<Enterprise> entList = findEntityList(Enterprise.class, f2);
                Enterprise enterprise;
                if (entList.size() > 0) {
                    //хотябы одно предприятие с совпадающим тайтлом
                    enterprise = entList.get(0);
                } else {
                    enterprise = new Enterprise();
                    enterprise.setTitle(c.job);
                    manager.persist(enterprise);
                    manager.flush();
                    manager.refresh(enterprise);
                    enterprise.setTreePath(enterprise.getId() + ".");
                    manager.persist(enterprise);
                }
                job = new Job();
                job.setClient(client);
                job.setEnterprise(enterprise);
                job.setBegin(DateTimeUtils.getDateOnly());
                manager.persist(job);
                manager.flush();
                manager.refresh(job);
            }
            if (c.appointmentID == 0) {
                job.setAppointment(null);
            } else {
                job.setAppointment(findEntity(Appointment.class, c.appointmentID));
            }
            manager.persist(job);
            manager.flush();
        }
View Full Code Here

    private void replaceProfession(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Job
        List entityList = findEntityList(Job.class, "profession", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Job job = (Job)entityList.get(i);
            job.setProfession((Profession) entityWith);
            manager.merge(job);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

    private void replaceAppointment(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Job
        List entityList = findEntityList(Job.class, "appointment", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Job job = (Job)entityList.get(i);
            job.setAppointment((Appointment) entityWith);
            manager.merge(job);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

TOP

Related Classes of beans.user.job.entity.Job

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.