Package org.milyn.scribe.invoker

Examples of org.milyn.scribe.invoker.DaoInvoker.lookup()


    ParameterContainer<?> container = ParameterManager.getParameterContainer(id, executionContext);
    DaoInvoker daoInvoker = DaoInvokerFactory.getInstance().create(dao, objectStore);

    if(query == null) {
      if(parameterListType == ParameterListType.NAMED) {
        return daoInvoker.lookup(lookupName, ((NamedParameterContainer) container).getParameterMap());
      } else {
        return daoInvoker.lookup(lookupName, ((PositionalParameterContainer) container).getValues());
      }
    } else {
      if(parameterListType == ParameterListType.NAMED) {
View Full Code Here


    if(query == null) {
      if(parameterListType == ParameterListType.NAMED) {
        return daoInvoker.lookup(lookupName, ((NamedParameterContainer) container).getParameterMap());
      } else {
        return daoInvoker.lookup(lookupName, ((PositionalParameterContainer) container).getValues());
      }
    } else {
      if(parameterListType == ParameterListType.NAMED) {
        return daoInvoker.lookupByQuery(query, ((NamedParameterContainer) container).getParameterMap());
      } else {
View Full Code Here

    DaoInvoker invoker = new AnnotatedDaoInvoker(fullDao, fullDaoRuntimeInfo);

    Map<String, Object> params = new HashMap<String, Object>();
    params.put("id", 1L);

    invoker.lookup("id", params);

    verify(fullDao).findById(1L);

  }
View Full Code Here

  public void test_lookup_with_method_name() {

    DaoInvoker invoker = new AnnotatedDaoInvoker(fullDao, fullDaoRuntimeInfo);

    invoker.lookup("findBy", "param");

    verify(fullDao).findBy(eq("param"));
  }

  public void test_lookup_with_name_param() {
View Full Code Here

    Map<String, Object> param = new HashMap<String, Object>();
    param.put("first", "henk");
    param.put("last", "janssen");

    invoker.lookup("name", param);

    verify(fullDao).findByName(eq("janssen"), eq("henk"));
  }

  public void test_lookup_with_positional_param() {
View Full Code Here

  public void test_lookup_with_positional_param() {

    DaoInvoker invoker = new AnnotatedDaoInvoker(fullDao, fullDaoRuntimeInfo);

    invoker.lookup("positional", "param1", 2, true);

    verify(fullDao).findBySomething(eq("param1"), eq(2), eq(true));
  }

View Full Code Here

  @Test(expectedExceptions = NoMethodWithAnnotationFoundException.class)
  public void test_lookup_no_annotation() {

    DaoInvoker invoker = new AnnotatedDaoInvoker(minimumDao, minimumDaoRuntimeInfo);

    invoker.lookup("id", Collections.emptyMap());

  }

  public void test_lookupByQuery_map_params() {
View Full Code Here

    DaoInvoker invoker = new InterfaceDaoInvoker(fullDao);

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

    invoker.lookup("id", params);

    verify(fullDao).lookup(eq("id"), same(params));

  }
View Full Code Here

    DaoInvoker invoker = new InterfaceDaoInvoker(minimumDao);

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

    invoker.lookup("id", params);

  }

  public void test_lookupByQuery_map_params() {
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.