Package org.apache.openjpa.validation

Examples of org.apache.openjpa.validation.ValidationUnavailableException


                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        new RuntimeException(e), true);
                } else {
                    // no optional validation provider, so just trace output
                    if (log.isTraceEnabled()) {
                        log.trace(_loc.get("vlem-creation-warn",
                            "No available javax.validation APIs"));
                    }
                    return brc;
                }
            }
            // we have the javax.validation APIs
            try {
                // try loading a validation provider
                ValidatorImpl validator = new ValidatorImpl(conf);
                // set the Validator into the config
                conf.setValidatorInstance(validator);
                // update the LifecycleEventManager plugin to use it
                conf.setLifecycleEventManager("validating");
                // all done, so return good rc if anyone cares
                brc = true;
            } catch (RuntimeException e) {
                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    // rethrow as a WrappedException
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        e, true);

                } else {
                    // unexpected, but validation is optional,
View Full Code Here


                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        new RuntimeException(e), true);
                } else {
                    // no optional validation provider, so just trace output
                    if (log.isTraceEnabled()) {
                        log.trace(_loc.get("vlem-creation-warn",
                            "No available javax.validation APIs"));
                    }
                    return brc;
                }
            }
            // we have the javax.validation APIs
            try {
                // try loading a validation provider
                ValidatorImpl validator = new ValidatorImpl(conf);
                // set the Validator into the config
                conf.setValidatorInstance(validator);
                // update the LifecycleEventManager plugin to use it
                conf.setLifecycleEventManager("validating");
                // all done, so return good rc if anyone cares
                brc = true;
            } catch (RuntimeException e) {
                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    // rethrow as a WrappedException
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        e, true);

                } else {
                    // unexpected, but validation is optional,
View Full Code Here

                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        new RuntimeException(e), true);
                } else {
                    // no optional validation provider, so just trace output
                    if (log.isTraceEnabled()) {
                        log.trace(_loc.get("vlem-creation-warn",
                            "No available javax.validation APIs"));
                    }
                    return brc;
                }
            }
            // we have the javax.validation APIs
            try {
                // try loading a validation provider
                ValidatorImpl validator = new ValidatorImpl(conf);
                // set the Validator into the config
                conf.setValidatorInstance(validator);
                // update the LifecycleEventManager plugin to use it
                conf.setLifecycleEventManager("validating");
                // all done, so return good rc if anyone cares
                brc = true;
            } catch (RuntimeException e) {
                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    // rethrow as a WrappedException
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        e, true);

                } else {
                    // unexpected, but validation is optional,
View Full Code Here

TOP

Related Classes of org.apache.openjpa.validation.ValidationUnavailableException

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.