congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
QueryBuilder.transform
Code IndexAdd Tabnine to your IDE (free)

How to use
transform
method
in
io.yawp.repository.query.QueryBuilder

Best Java code snippets using io.yawp.repository.query.QueryBuilder.transform (Showing top 6 results out of 315)

origin: feroult/yawp

private List<?> list(QueryBuilder<?> query) {
  List<?> objects;
  if (hasTransformer()) {
    objects = query.transform(getTransformerName()).list();
  } else {
    objects = query.list();
    applyGetFacade(objects);
  }
  return objects;
}
origin: feroult/yawp

@Test
public void testListResultWithSort() {
  yawp.save(new BasicObject("xpto1"));
  yawp.save(new BasicObject("xpto2"));
  List<Map<String, Object>> list = yawp(BasicObject.class).<Map<String, Object>>transform("simple").sort("innerValue", "desc")
      .list();
  assertEquals("xpto2", list.get(0).get("innerValue"));
  assertEquals("xpto1", list.get(1).get("innerValue"));
}
origin: feroult/yawp

@Test
public void testAddAttribute() {
  yawp.save(new BasicObject("xpto1"));
  Map<String, Object> map = yawp(BasicObject.class).<Map<String, Object>>transform("addAttribute").first();
  assertEquals("xpto", map.get("attr"));
}
origin: feroult/yawp

@Test
public void testSingleResult() {
  BasicObject object = new BasicObject("xpto");
  yawp.save(object);
  Map<String, Object> map = yawp(BasicObject.class).<Map<String, Object>>transform("simple").fetch(object.getId());
  assertEquals("xpto", map.get("innerValue"));
  assertEquals("xpto", ((BasicObject) map.get("innerObject")).getStringValue());
}
origin: feroult/yawp

@Override
public Object action() {
  QueryBuilder<?> query = query();
  try {
    if (hasTransformer()) {
      Object object = query.transform(getTransformerName()).fetch(id);
      applyGetFacade(object);
      return object;
    }
    if (hasShieldCondition()) {
      query.and(shield.getWhere());
    }
    Object object = query.fetch(id);
    applyGetFacade(object);
    return object;
  } catch (NoResultException e) {
    throw new HttpException(404);
  }
}
origin: feroult/yawp

@Test
public void testTransformWithChild() {
  Parent parent = new Parent();
  yawp.save(parent);
  Child child = new Child();
  child.setName("xpto");
  child.setParentId(parent.getId());
  yawp.save(child);
  Child retrievedChild = yawp(Child.class).<Child>transform("simple").first();
  assertEquals("transformed xpto", retrievedChild.getName());
}
io.yawp.repository.queryQueryBuildertransform

Popular methods of QueryBuilder

  • from
  • getCursor
  • getModel
  • cursor
  • getCondition
  • getLimit
  • getParentId
  • getPreOrders
  • ids
  • limit
  • list
  • order
  • list,
  • order,
  • setCursor,
  • where,
  • and,
  • fetch,
  • first,
  • getForcedResult,
  • getRepository,
  • hasForcedResponse

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now