Package org.milyn.scribe.reflection

Examples of org.milyn.scribe.reflection.LookupWithPositionalQueryMethod


  /* (non-Javadoc)
   * @see org.milyn.scribe.invoker.DAOInvoker#findByQuery(java.lang.String, java.lang.Object[])
   */
  public Object lookupByQuery(final String query, final Object ... parameters) {

    final LookupWithPositionalQueryMethod method = daoRuntimeInfo.getLookupByPositionalQueryMethod();

    if(method == null) {
      throw new NoMethodWithAnnotationFoundException("No method found in DAO class '" + dao.getClass().getName() + "' that is annotated " +
          "with '" + LookupByQuery.class.getSimpleName() + "' annotation and has an Array argument for the positional parameters.");
    }

    return method.invoke(dao, query, parameters);

  }
View Full Code Here


  }


  public void test_getFindByPositionalQueryMethod() {

    LookupWithPositionalQueryMethod method = fullAnnotatedDaoRuntimeInfo.getLookupByPositionalQueryMethod();

    assertNotNull(method);

    Object[] params = new Object[0];

    method.invoke(fullAnnotatedDao, "query", params);

    verify(fullAnnotatedDao).findByQuery(eq("query"), same(params));

    assertNull(minimumAnnotatedDaoRuntimeInfo.getLookupByPositionalQueryMethod());
View Full Code Here

TOP

Related Classes of org.milyn.scribe.reflection.LookupWithPositionalQueryMethod

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.