Package net.sf.autodao

Examples of net.sf.autodao.Finder.query()


    final Finder f = AnnotationUtils.getAnnotation(method, Finder.class);
    if (f == null)
      throw new SpecificationViolationException("Method is neither a finder method nor is implemented in AutoDAO", method);

    final int sum
        = (hasText(f.query()) ? 1 : 0)
        + (hasText(f.queryName()) ? 1 : 0)
        + (hasText(f.sqlQuery()) ? 1 : 0)
        + (hasText(f.sqlQueryName()) ? 1 : 0);
    if (sum < 1)
      throw new SpecificationViolationException("You need to specify at least one of: query, queryName, sqlQuery, sqlQueryName", method);
View Full Code Here


    void visit(final int index, @NotNull final Class<?> type, @NotNull final Annotation[] annotations);
  }

  public static <T> T visitQuery(@NotNull final Method method, @NotNull final QueryVisitor<T> visitor) {
    final Finder finder = AnnotationUtils.findAnnotation(method, Finder.class);
    if (StringUtils.hasText(finder.query())) {
      return visitor.visitQuery(finder.query());
    } else if (StringUtils.hasText(finder.sqlQuery())) {
      return visitor.visitSQLQuery(finder.sqlQuery());
    } else if (StringUtils.hasText(finder.sqlQueryName())) {
      return visitor.visitSQLNamedQuery(finder.sqlQueryName());
View Full Code Here

  }

  public static <T> T visitQuery(@NotNull final Method method, @NotNull final QueryVisitor<T> visitor) {
    final Finder finder = AnnotationUtils.findAnnotation(method, Finder.class);
    if (StringUtils.hasText(finder.query())) {
      return visitor.visitQuery(finder.query());
    } else if (StringUtils.hasText(finder.sqlQuery())) {
      return visitor.visitSQLQuery(finder.sqlQuery());
    } else if (StringUtils.hasText(finder.sqlQueryName())) {
      return visitor.visitSQLNamedQuery(finder.sqlQueryName());
    } else {
View Full Code Here

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.