Package org.apache.cayenne.validation

Examples of org.apache.cayenne.validation.SimpleValidationFailure


                    .currentThread()
                    .getContextClassLoader());
            return (DbAdapter) dbAdapterClass.newInstance();
        }
        catch (Exception e) {
            context.recordConflict(new SimpleValidationFailure(
                    info,
                    "Failed to load adapter '"
                            + adapterClass
                            + "', message: "
                            + e.getLocalizedMessage()));
View Full Code Here


        catch (SQLException ex) {
            if (this.failures == null) {
                this.failures = new ValidationResult();
            }

            failures.addFailure(new SimpleValidationFailure(sql, ex.getMessage()));
            jdbcEventLogger.logQueryError(ex);
            return false;
        }
        finally {
            statement.close();
View Full Code Here

            st = conn.createStatement();
            st.execute(sql);
        }
        catch (SQLException e) {
            mergerContext.getValidationResult().addFailure(
                    new SimpleValidationFailure(sql, e.getMessage()));
            QueryLogger.logQueryError(e);
        }
        finally {
            if (st != null) {
                try {
View Full Code Here

        catch (SQLException ex) {
            if (this.failures == null) {
                this.failures = new ValidationResult();
            }

            failures.addFailure(new SimpleValidationFailure(sql, ex.getMessage()));
            QueryLogger.logQueryError(ex);
            return false;
        }
        finally {
            statement.close();
View Full Code Here

                    Collections.singletonList(getEntity()));
            executeSql(mergerContext, adapter.createTable(getEntity()));
        }
        catch (Exception e) {
            mergerContext.getValidationResult().addFailure(
                    new SimpleValidationFailure(this, e.getMessage()));
        }
    }
View Full Code Here

                    .currentThread()
                    .getContextClassLoader());
            return (DbAdapter) dbAdapterClass.newInstance();
        }
        catch (Exception e) {
            context.recordConflict(new SimpleValidationFailure(
                    info,
                    "Failed to load adapter '"
                            + adapterClass
                            + "', message: "
                            + e.getLocalizedMessage()));
View Full Code Here

     */
    public void loadClassMapping(Class<?> managedClass) throws JpaProviderException {

        // avoid duplicates loaded from annotations per CAY-756
        if (context.getEntityMap().getManagedClass(managedClass.getName()) != null) {
            context.recordConflict(new SimpleValidationFailure(
                    managedClass.getName(),
                    "Duplicate managed class declaration " + managedClass.getName()));
            return;
        }

View Full Code Here

            if (message != null) {
                buffer.append(", details: ").append(message);
            }

            context
                    .recordConflict(new SimpleValidationFailure(peek(), buffer.toString()));
        }
View Full Code Here

                        case STRING:
                            entity.setDiscriminatorValue(entity.getName());
                            break;
                        default:
                            context.recordConflict(new SimpleValidationFailure(
                                    entity,
                                    "Can't guess default discriminator value for non-String discriminator column: "
                                            + discriminator.getName()));
                    }
                }
View Full Code Here

            JpaEntityMap map = path.firstInstanceOf(JpaEntityMap.class);
            JpaEntity target = map.entityForClass(relationship.getTargetEntityName());

            if (target == null) {
                context.recordConflict(new SimpleValidationFailure(
                        relationship,
                        "Invalid relationship target "
                                + relationship.getTargetEntityName()));
            }
            else if (target.getAttributes() == null
                    || target.getAttributes().getIds().isEmpty()) {
                context.recordConflict(new SimpleValidationFailure(
                        target,
                        "Relationship target has no PK defined: "
                                + relationship.getTargetEntityName()));
            }
            else if (target.getAttributes().getIds().size() > 1) {
                // TODO: andrus, 4/30/2006 implement this; note that instead of
                // checking for "attribute.getJoinColumns().isEmpty()" above,
                // we'll have to match individual columns
                context.recordConflict(new SimpleValidationFailure(
                        relationship,
                        "Defaults for compound FK are not implemented."));
            }
            else {
                JpaId id = target.getAttributes().getIds().iterator().next();
View Full Code Here

TOP

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

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.