Package org.apache.cayenne.validation

Examples of org.apache.cayenne.validation.SimpleValidationFailure


                JpaPropertyDescriptor property = srcDescriptor.getProperty(name);

                Class<?> targetEntityType = property.getTargetEntityType();

                if (targetEntityType == null) {
                    context.recordConflict(new SimpleValidationFailure(property
                            .getMember(), "Undefined target entity type: " + name));
                    return false;
                }
                else {
                    relationship.setTargetEntityName(targetEntityType.getName());
View Full Code Here


            }
            else {
                String path = descriptor.getManagedClass().getName()
                        + "."
                        + property.getName();
                context.recordConflict(new SimpleValidationFailure(
                        property.getMember(),
                        "Undefined property persistence status: " + path));
            }
        }
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

            }
        }
    }

    protected void recordConflict(ProjectPath path, String message) {
        context.recordConflict(new SimpleValidationFailure(path.getObject(), message));
    }
View Full Code Here

            conn = dataSource.getConnection();
            st = conn.createStatement();
            st.execute(sql);
        }
        catch (SQLException e) {
            result.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

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

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

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

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

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

            }
        }
    }

    protected void recordConflict(ProjectPath path, String message) {
        context.recordConflict(new SimpleValidationFailure(path.getObject(), message));
    }
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.