Package org.apache.cayenne.validation

Examples of org.apache.cayenne.validation.ValidationException


                }
            }
        }

        if (result.hasFailures()) {
            throw new ValidationException(result);
        }

        return noop;
    }
View Full Code Here


                && remoteUpdates.isSelected());
    }

    void setDomainName(String newName) {
        if (newName == null || newName.trim().length() == 0) {
            throw new ValidationException("Enter name for DataDomain");
        }

        Configuration configuration = ((ApplicationProject) Application.getProject())
                .getConfiguration();
        DataDomain domain = projectController.getCurrentDataDomain();

        DataDomain matchingDomain = configuration.getDomain(newName);

        if (matchingDomain == null) {
            Domain prefs = projectController.getPreferenceDomainForDataDomain();

            DomainEvent e = new DomainEvent(this, domain, domain.getName());
            ProjectUtil.setDataDomainName(configuration, domain, newName);
            prefs.rename(newName);
            projectController.fireDomainEvent(e);
        }
        else if (matchingDomain != domain) {
            throw new ValidationException("There is another DataDomain named '"
                    + newName
                    + "'. Use a different name.");
        }
    }
View Full Code Here

        if (text.length() > 0) {
            try {
                Integer.parseInt(text);
            }
            catch (NumberFormatException ex) {
                throw new ValidationException("Cache size must be an integer: " + text);
            }
        }

        setDomainProperty(DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY, text, Integer
                .toString(DataRowStore.SNAPSHOT_CACHE_SIZE_DEFAULT));
View Full Code Here

                        }
                    }
                }

                if (result.hasFailures()) {
                    throw new ValidationException(result);
                }

                graphManager.graphCommitStarted();

                try {
View Full Code Here

                        break;
                }
            }

            if (result.hasFailures()) {
                throw new ValidationException(result);
            }
        }

        return noop;
    }
View Full Code Here

                        }
                    }
                }

                if (result.hasFailures()) {
                    throw new ValidationException(result);
                }

                graphManager.graphCommitStarted();

                GraphDiff changes = graphManager.getDiffsSinceLastFlush();
View Full Code Here

                        }
                    }
                }

                if (result.hasFailures()) {
                    throw new ValidationException(result);
                }

                graphManager.graphCommitStarted();

                try {
View Full Code Here

        eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
    }

    void setDataMapName(String newName) {
        if (newName == null || newName.trim().length() == 0) {
            throw new ValidationException("Enter name for DataMap");
        }

        DataMap map = eventController.getCurrentDataMap();

        // search for matching map name across domains, as currently they have to be
        // unique globally
        DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) Application
                .getInstance()
                .getProject()
                .getRootNode();

        DataMap matchingMap = dataChannelDescriptor.getDataMap(newName);

        if (matchingMap != null && !matchingMap.equals(map)) {

            // there is an entity with the same name
            throw new ValidationException("There is another DataMap named '"
                    + newName
                    + "'. Use a different name.");
        }
        String oldName = map.getName();
        if (Util.nullSafeEquals(newName, oldName)) {
View Full Code Here

                        }
                    }
                }

                if (result.hasFailures()) {
                    throw new ValidationException(result);
                }

                graphManager.graphCommitStarted();

                GraphDiff changes = graphManager.getDiffsSinceLastFlush();
View Full Code Here

                        break;
                }
            }

            if (result.hasFailures()) {
                throw new ValidationException(result);
            }
        }

        return noop;
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.validation.ValidationException

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.