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

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

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

origin: feroult/yawp

public QueryTransformer<F, T> order(String property, String direction) {
  query.order(property, direction);
  return this;
}
origin: feroult/yawp

public QueryBuilder<T> order(String property) {
  order(property, null);
  return this;
}
origin: feroult/yawp

private List<Work> listWorks() {
  return r.query(Work.class).where("indexHash", "=", indexHash).order("id").list();
}
origin: feroult/yawp

private void orderById(QueryBuilder q) {
  ObjectModel model = new ObjectHolder(sink).getModel();
  q.order(model.getIdFieldName());
}
origin: feroult/yawp

private QueryBuilder<SinkMarker> prepareQuery() {
  QueryBuilder<SinkMarker> q = r.query(SinkMarker.class).from(sinkId).order("id").limit(BATCH_SIZE);
  if (cursor != null) {
    q.cursor(cursor);
  }
  return q;
}
origin: feroult/yawp

  private List<? extends IdRef<?>> sinkIds() {
    QueryBuilder<?> q = r.query(sinkClazz).order("id").limit(BATCH_SIZE);
    if (cursor != null) {
      q.cursor(cursor);
    }
    List<? extends IdRef<?>> ids = q.ids();
    if (ids.size() < BATCH_SIZE) {
      cursor = null;
    } else {
      cursor = q.getCursor();
    }
    return ids;
  }
}
origin: feroult/yawp

  private List<? extends IdRef<?>> sourceIds() {
    QueryBuilder<?> q = r.query(sourceClazz).order("id").limit(BATCH_SIZE);
    if (cursor != null) {
      q.cursor(cursor);
    }
    List<? extends IdRef<?>> ids = q.ids();
    if (ids.size() < BATCH_SIZE) {
      cursor = null;
    } else {
      cursor = q.getCursor();
    }
    return ids;
  }
}
origin: feroult/yawp

  private List<? extends IdRef<?>> sinkMarkerIds() {
    QueryBuilder<?> q = r.query(SinkMarker.class).from(sinkId).order("id").limit(BATCH_SIZE);
    if (cursor != null) {
      q.cursor(cursor);
    }
    List<? extends IdRef<?>> ids = q.ids();
    if (ids.size() < BATCH_SIZE) {
      cursor = null;
    } else {
      cursor = q.getCursor();
    }
    return ids;
  }
}
origin: feroult/yawp

@Test
public void testLimit() {
  saveManyBasicObjects(3);
  List<BasicObject> objects = yawp(BasicObject.class).order("intValue", "desc").limit(1).list();
  assertEquals(1, objects.size());
  assertEquals(3, objects.get(0).getIntValue());
}
origin: feroult/yawp

@Test
public void testOrderWithTwoProperties() {
  saveManyBasicObjects(2, "xpto1");
  saveManyBasicObjects(2, "xpto2");
  List<BasicObject> objects = yawp(BasicObject.class).order("stringValue", "desc").order("intValue", "desc").list();
  assertEquals(4, objects.size());
  assertEquals("xpto2", objects.get(0).getStringValue());
  assertEquals("xpto2", objects.get(1).getStringValue());
  assertEquals("xpto1", objects.get(2).getStringValue());
  assertEquals("xpto1", objects.get(3).getStringValue());
  assertEquals(2, objects.get(0).getIntValue());
  assertEquals(1, objects.get(1).getIntValue());
  assertEquals(2, objects.get(2).getIntValue());
  assertEquals(1, objects.get(3).getIntValue());
}
origin: feroult/yawp

@PUT("touched")
public List<Parent> touch() {
  List<Parent> parents = yawp(Parent.class).order("name").list();
  for (Parent parent : parents) {
    parent.setName("touched " + parent.getName());
  }
  return parents;
}
origin: feroult/yawp

@Test
public void testCursor() {
  saveManyBasicObjects(3);
  QueryBuilder<BasicObject> q = yawp(BasicObject.class).order("intValue", "desc").limit(1);
  List<BasicObject> objects1 = q.list();
  assertEquals(3, objects1.get(0).getIntValue());
  List<BasicObject> objects2 = q.list();
  assertEquals(2, objects2.get(0).getIntValue());
  List<BasicObject> objects3 = yawp(BasicObject.class).cursor(q.getCursor()).order("intValue", "desc").limit(1).list();
  assertEquals(1, objects3.get(0).getIntValue());
}
origin: feroult/yawp

@Test
public void testFindByIdUsingWhereIn() {
  BasicObject object1 = new BasicObject("xpto1");
  yawp.save(object1);
  BasicObject object2 = new BasicObject("xpto2");
  yawp.save(object2);
  final List<IdRef<BasicObject>> ids = Arrays.asList(object1.getId(), object2.getId());
  List<BasicObject> objects = yawp(BasicObject.class).where("id", "in", ids).order("stringValue").list();
  assertEquals(2, objects.size());
  assertEquals("xpto1", objects.get(0).getStringValue());
  assertEquals("xpto2", objects.get(1).getStringValue());
}
origin: feroult/yawp

@Test
public void testOrderWithUnicode() {
  yawp.save(new BasicObject("\u00e1"));
  yawp.save(new BasicObject("\u00e9"));
  yawp.save(new BasicObject("\u00ed"));
  List<BasicObject> objects = yawp(BasicObject.class).order("stringValue", "desc").list();
  assertEquals(3, objects.size());
  assertEquals("\u00ed", objects.get(0).getStringValue());
  assertEquals("\u00e9", objects.get(1).getStringValue());
  assertEquals("\u00e1", objects.get(2).getStringValue());
}
origin: feroult/yawp

@PUT("touched")
public List<Child> touchCollection(IdRef<Parent> parentId) {
  List<Child> childs = yawp(Child.class).from(parentId).order("name").list();
  for (Child child : childs) {
    child.setName("touched " + child.getName());
  }
  return childs;
}
origin: feroult/yawp

@Test
public void testWithIdAsStringIn() {
  BasicObject myObj1 = new BasicObject("xpto1");
  yawp.save(myObj1);
  BasicObject myObj2 = new BasicObject("xpto2");
  yawp.save(myObj2);
  List<BasicObject> objects = yawp(BasicObject.class)
      .where("id", "in", Arrays.asList(myObj1.getId().toString(), myObj2.getId().toString())).order("stringValue").list();
  assertEquals(2, objects.size());
  assertEquals("xpto1", objects.get(0).getStringValue());
  assertEquals("xpto2", objects.get(1).getStringValue());
}
io.yawp.repository.queryQueryBuilderorder

Popular methods of QueryBuilder

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

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • String (java.lang)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Vim 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