Package org.milyn.scribe.reflection

Examples of org.milyn.scribe.reflection.LookupWithNamedQueryMethod


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

    final LookupWithNamedQueryMethod method = daoRuntimeInfo.getLookupByNamedQueryMethod();

    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 a Map argument for the named parameters.");
    }

    return method.invoke(dao, query, parameters);
  }
View Full Code Here


  }


  public void test_getFindByNamedQueryMethod() {

    LookupWithNamedQueryMethod method = fullAnnotatedDaoRuntimeInfo.getLookupByNamedQueryMethod();

    assertNotNull(method);

    Map<String, Object> params = new HashMap<String, Object>();

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

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

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

TOP

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

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.