Package org.apache.cayenne.validation

Examples of org.apache.cayenne.validation.ValidationResult


        try {
            DataSource dataSource = connectionInfo.makeDataSource(getApplication()
                    .getClassLoadingService());
            generator.runGenerator(dataSource);

            ValidationResult failures = generator.getFailures();

            if (failures == null || !failures.hasFailures()) {
                JOptionPane.showMessageDialog(getView(), "Schema Generation Complete.");
            }
            else {
                new ValidationResultBrowser(this)
                        .startupAction("Schema Generation Complete",
View Full Code Here


    public abstract Component getView();

    public void validate(GeneratorController validator) {

        ValidationResult validationBuffer = new ValidationResult();

        if (validator != null) {
            Iterator it = entities.iterator();
            while (it.hasNext()) {
                validator.validateEntity(validationBuffer, (ObjEntity) it.next(), false);
View Full Code Here

            allFailures.addAll(loadFailures);
        }

        ProjectValidator projectValidator = getApplication().getInjector().getInstance(
                ProjectValidator.class);
        ValidationResult validationResult = projectValidator.validate(project
                .getRootNode());
        allFailures.addAll(validationResult.getFailures());

        if (!allFailures.isEmpty()) {
            ValidatorDialog.showDialog(frame, validationResult.getFailures());
        }
    }
View Full Code Here

        synchronized (graphManager) {

            if (graphManager.hasChanges()) {

                ValidationResult result = new ValidationResult();
                Iterator<?> it = graphManager.dirtyNodes().iterator();
                while (it.hasNext()) {
                    Persistent p = (Persistent) it.next();
                    if (p instanceof Validating) {
                        switch (p.getPersistenceState()) {
                            case PersistenceState.NEW:
                                ((Validating) p).validateForInsert(result);
                                break;
                            case PersistenceState.MODIFIED:
                                ((Validating) p).validateForUpdate(result);
                                break;
                            case PersistenceState.DELETED:
                                ((Validating) p).validateForDelete(result);
                                break;
                        }
                    }
                }

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

                graphManager.graphCommitStarted();
View Full Code Here

                        .getFrameController()
                        .getProjectController();
                projectController.setDirty(true);
            }

            ValidationResult failures = mergerContext.getValidationResult();

            if (failures == null || !failures.hasFailures()) {
                JOptionPane.showMessageDialog(getView(), "Migration Complete.");
            }
            else {
                new ValidationResultBrowser(this).startupAction(
                        "Migration Complete",
View Full Code Here

        try {
            DataSource dataSource = connectionInfo.makeDataSource(getApplication()
                    .getClassLoadingService());
            generator.runGenerator(dataSource);

            ValidationResult failures = generator.getFailures();

            if (failures == null || !failures.hasFailures()) {
                JOptionPane.showMessageDialog(getView(), "Schema Generation Complete.");
            }
            else {
                new ValidationResultBrowser(this)
                        .startupAction(
View Full Code Here

                    this,
                    "adapterClassName",
                    adapterClassName);

            if (failure != null) {
                ValidationResult result = new ValidationResult();
                result.addFailure(failure);
                throw new ValidationException(failure.getDescription(), result);
            }
        }
    }
View Full Code Here

    public abstract Component getView();

    public void validate(GeneratorController validator) {

        ValidationResult validationBuffer = new ValidationResult();

        if (validator != null) {
            for (Object classObj : classes) {
                if (classObj instanceof ObjEntity) {
                    validator.validateEntity(
View Full Code Here

        synchronized (graphManager) {

            if (graphManager.hasChanges()) {

                if (isValidatingObjectsOnCommit()) {
                    ValidationResult result = new ValidationResult();
                    Iterator<?> it = graphManager.dirtyNodes().iterator();
                    while (it.hasNext()) {
                        Persistent p = (Persistent) it.next();
                        if (p instanceof Validating) {
                            switch (p.getPersistenceState()) {
                                case PersistenceState.NEW:
                                    ((Validating) p).validateForInsert(result);
                                    break;
                                case PersistenceState.MODIFIED:
                                    ((Validating) p).validateForUpdate(result);
                                    break;
                                case PersistenceState.DELETED:
                                    ((Validating) p).validateForDelete(result);
                                    break;
                            }
                        }
                    }

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

                graphManager.graphCommitStarted();
View Full Code Here

            }

            long t1 = System.currentTimeMillis();

            // report conflicts...
            ValidationResult conflicts = loader.getContext().getConflicts();
            if (conflicts.hasFailures()) {
                for (Object failure : conflicts.getFailures()) {
                    logger.info("*** mapping conflict: " + failure);
                }
            }

            if (logger.isDebugEnabled()) {
View Full Code Here

TOP

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

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.