Examples of EDataIntegrity


Examples of framework.generic.EDataIntegrity

    }

    @Override
    protected void onRemove(ReportDefinition entity, List<AuditDoc> audit) throws ClipsServerException {
        if (!HardCodedIDs.canRemove(entity.getClass(), entity.getId())) {
            throw new EDataIntegrity("Попытка удалить специальный отчет");
        }
        FileTable file = null;
        ArrayList<FileDetails> files = getFiles();
        for (FileDetails fileDetails : files) {
            removeFile(fileDetails.id);
View Full Code Here

Examples of framework.generic.EDataIntegrity

                entFile.setReport(entity);
            }
            entFile.setFileName(file.fileName);
            entFile.setFileTypeId(file.fileTypeID);
            if (file.fileData == null && entData == null) {
                throw new EDataIntegrity("Файл должен содержать данные");
            }
            entFile = saveFile(entFile);

            entData = getDataToFile(entFile);
            if (file.fileData != null) {
View Full Code Here

Examples of framework.generic.EDataIntegrity

                    fileTable.setFileName(file.getFileName());
                    fileTable.setFileTypeId(file.getFileTypeId());
                    file = fileTable;
                    break;
                } else {
                    throw new EDataIntegrity("Попытка задать файлу имя уже существующего файла");
                }
            }
        }

        if (file.getId() != 0) {
View Full Code Here

Examples of framework.generic.EDataIntegrity

                fileReportID = file.getReport().getId() == 0
                        ? "<несохранен>"
                        : String.valueOf(file.getReport().getId());
            }

            throw new EDataIntegrity("Указан неверный идентификатор файла: ID отчета:"
                    + entity.getId() + ", ID отчета в файле: " + fileReportID);
        }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     * @param title название с отрезанными пробелами
     * @throws ClipsServerException
     */
    protected void checkTitleValid(String title) throws ClipsServerException {
        if (title == null || title.isEmpty()) {
            throw new EDataIntegrity("Название не задано");
        }
        if (title.charAt(0) == HIDE_SYMBOL){
            throw new EDataIntegrity("Название не может начинаться с символа \""
                    + HIDE_SYMBOL + "\"");
        }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

    @Override
    protected void onRemove(ReportType entity) throws ClipsServerException {
        Field f1[] = { new Field("parent", entity) };

        if(getEntityCount(ReportType.class, f1) > 0) {
            throw new EDataIntegrity("Удаление невозможно, группа содержит вложенные группы");
        }

    Field f2[] = { new Field("reportType", entity) };
        if(getEntityCount(ReportgenQuery.class, f2) > 0) {
            throw new EDataIntegrity("Удаление невозможно, группа содержит вложенные отчеты");
        }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     * @param entity
     * @throws generic.ClipsServerException
     */
    @Override
    protected void onRemove(AddressObjectType entity) throws ClipsServerException {
        throw new EDataIntegrity("Запрещено");
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     *
     * @param details
     */
    @Override
    protected void onAppend(AddressObjectTypeDetails details) throws ClipsServerException {
        throw new EDataIntegrity("Запрещено");
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

        Iterator iterator = findEntityList(entityClass, f).iterator();
        while (iterator.hasNext()) {
            DirectoryEntity de = (DirectoryEntity)iterator.next();
            if (item.id != de.getId()) {
                throw new EDataIntegrity("Элемент справочника с таким названием (или внешним ключем) уже присутствует в базе");
            }
        }

    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

    @Override
    protected void onUpdate(ProfcheckupItem entity, EntityDetails details,
            AuditDoc auditDoc, List<AuditDoc> auditDocList) throws ClipsServerException{
        ProfcheckupItemDetails d = (ProfcheckupItemDetails) details;
        if (d.dangerId != entity.getDanger().getId()){
            throw new EDataIntegrity("Запрещено менять назначенный опасный фактор!");
        }
        if (d.diseaseID != entity.getDisease().getId()){
            throw new EDataIntegrity("Запрещено подменять заболевание!");
        }
        if (d.profcheckupID != entity.getProfcheckup().getId()){
            throw new EDataIntegrity("Запрещено подменять профосмотр!");
        }
        if (d.polisID != entity.getPolis().getId()){
            throw new EDataIntegrity("Запрещено подменять члена договора!");
        }

        //Если профосмотр не оказан, то остальные данные писать нельзя
        entity.setPassed(d.passed);
//        entity.setPolis(findEntity(ContractMemeber.class, d.polisID));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.