Examples of ConstraintViolationException


Examples of javax.validation.ConstraintViolationException


  protected void validate(AbstractEntity entity) {
    Set<ConstraintViolation<AbstractEntity>> validate = validator.validate(entity);
    if (!CollectionUtils.isEmpty(validate)) {
      throw new ConstraintViolationException((Set)validate);
    }
  }

Examples of javax.validation.ConstraintViolationException

    Set violations = validator.validate(source);

    if (!violations.isEmpty()) {

      LOG.info("During object: {} validation violations found: {}", source, violations);
      throw new ConstraintViolationException(violations);
    }
  }

Examples of javax.validation.ConstraintViolationException

    private void validateMember(Member member) throws ConstraintViolationException, ValidationException {
        //Create a bean validator and check for issues.
        Set<ConstraintViolation<Member>> violations = validator.validate(member);

        if (!violations.isEmpty()) {
            throw new ConstraintViolationException(new HashSet<ConstraintViolation<?>>(violations));
        }

        //Check the uniqueness of the email address
        if (emailAlreadyExists(member.getEmail())) {
            throw new ValidationException("Unique Email Violation");

Examples of nexj.core.persistence.ConstraintViolationException

                     bCancel = (instance != null && instance.tryLoad());
                  }

                  if (bCancel)
                  {
                     ConstraintViolationException e = new ConstraintViolationException(
                        "err.persistence.cascadeCancel",
                        new Object[]{new StringId(m_metaclass.getCaption()),
                           getName(), new StringId(attribute.getCaption())});

                     e.setClassName(getClassName());
                     e.setOIDHolder(this);

                     throw e;
                  }
               }
            }

Examples of org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException

       
        Span commit = Trace.start("commit");
        cs.commit(mutations);
        commit.stop();
      } catch (TConstraintViolationException e) {
        throw new ConstraintViolationException(Translator.translate(e.getViolations().asList(), Translators.CVST));
      } finally {
        writeTracker.finishWrite(opid);
      }
    }

Examples of org.apache.phoenix.schema.ConstraintViolationException

                    }
                    for (i = posOffset; i < table.getPKColumns().size(); i++) {
                        PColumn pkCol = table.getPKColumns().get(i);
                        if (!pkColumnsSet.get(i)) {
                            if (!pkCol.isNullable()) {
                                throw new ConstraintViolationException(table.getName().getString() + "." + pkCol.getName().getString() + " may not be null");
                            }
                        }
                    }
                }
                boolean isAutoCommit = connection.getAutoCommit();

Examples of org.apache.torque.ConstraintViolationException

    @Override
    public TorqueException toTorqueException(SQLException sqlException)
    {
        if (StringUtils.startsWith(sqlException.getSQLState(), "23"))
        {
            return new ConstraintViolationException(sqlException);
        }
        if (StringUtils.equals(sqlException.getSQLState(), "40001"))
        {
            // mysql, derby, mssql
            return new DeadlockException(sqlException);

Examples of org.graphity.processor.exception.ConstraintViolationException

  if (!cvs.isEmpty())
        {
            if (log.isDebugEnabled()) log.debug("SPIN constraint violations: {}", cvs);
            if (mode != null && mode.equals(URI.create(GC.EditMode.getURI()))) // check by HTTP request method?
            {
                throw new ConstraintViolationException(cvs, model);
            }
            else // gc:CreateMode
            {
                QueriedResource match = (QueriedResource)getUriInfo().getMatchedResources().get(0);
                throw new ConstraintViolationException(cvs, match.describe().add(model));
            }
        }
       
        return model;
    }

Examples of org.hibernate.exception.ConstraintViolationException

          throw new LockTimeoutException( message, sqlException, sql );
        }
        if ( 515 == errorCode && "ZZZZZ".equals( sqlState ) ) {
          // Attempt to insert NULL value into column; column does not allow nulls.
          final String constraintName = getViolatedConstraintNameExtracter().extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
        }
        return null;
      }
    };
  }

Examples of org.qi4j.api.constraint.ConstraintViolationException

        if( constraints != null )
        {
            List<ConstraintViolation> violations = constraints.checkConstraints( value );
            if( !violations.isEmpty() )
            {
                throw new ConstraintViolationException( "<new instance>", "<unknown>", ((Member)accessor), violations );
            }
        }
    }
TOP
Copyright © 2018 www.massapi.com. 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.