Package org.apache.cayenne.validation

Examples of org.apache.cayenne.validation.SimpleValidationFailure


        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


        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

     */
    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

                        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

                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

            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.