Package com.jdkcn.myblog.condition

Examples of com.jdkcn.myblog.condition.EntryCondition


  /**
   * {@inheritDoc}
   */
  public PaginationSupport<Entry> search(Condition condition, Range range, Sorter sorter) {
    if (condition == null) {
      condition = new EntryCondition();
    }
    String hql = condition.decorateHql();
    Query countQuery = entityManagerProvider.get().createQuery("select count(*) " + hql);
    condition.setParameters(countQuery);
   
View Full Code Here


    this.size = size;
  }

  @Get
  public void get() {
    EntryCondition condition = new EntryCondition();
    if (size == null) {
      size = Constants.DEFAULT_PAGE_SIZE;
    }
    int start = 0;
    if (p != null && p > 1) {
View Full Code Here

    String title = "Title";
    String content = "Content";
    for (int i = 0; i < 30; i++) {
      createEntry(title + i, content + i);
    }
    EntryCondition condition = new EntryCondition();
    PaginationSupport<Entry> ps = entryService.search(condition, new Range(0, 10), new Sorter().asc("publishDate"));
    assertEquals(30, ps.getTotalCount());
   
    title = "Android";
    for (int j = 0; j < 5; j ++) {
      createEntry(title + j, content + j);
    }
   
    condition.setKeyword("Android");
    ps = entryService.search(condition, new Range(0, 5), new Sorter().asc("title"));
    assertEquals(5, ps.getTotalCount());
  }
View Full Code Here

TOP

Related Classes of com.jdkcn.myblog.condition.EntryCondition

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.