Package com.tll.dao

Examples of com.tll.dao.Sorting


    assert elements != null && elements.size() > 0 : "No elements exist - test can't run";
    assert elements.size() >= 10 : "At least 10 list elements must be present for this test";
    final int pageSize = 3;

    final Criteria<Address> criteria = new Criteria<Address>(Address.class);
    final Sorting sorting = new Sorting(new SortColumn("emailAddress"));
    final IListHandler<SearchResult<?>> listHandler =
      ListHandlerFactory.create(criteria, sorting, ListHandlerType.PAGE, dataProvider);

    List<SearchResult<?>> list;
View Full Code Here


  public final void onListingEvent(ListingEvent<R> event) {
    if(event.getListingOp().isQuery()) {
      removeBodyRows();
      if(event.getPageElements() != null) {
        addBodyRows(event.getPageElements(), event.getOffset());
        final Sorting sorting = event.getSorting();
        if(sortlinks != null && sorting != null) applySorting(sorting);
        crntPage = event.getPageNum() + 1;
        numPages = event.getNumPages();
        actvRowIndex = crntRowIndex = -1; // reset
      }
View Full Code Here

    public void onClick(ClickEvent event) {
      event.stopPropagation();
      final SortColumn sc =
          new SortColumn(column.getPropertyName(), column.getParentAlias(), direction == SortDir.ASC ? SortDir.DESC
              : SortDir.ASC, column.isIgnoreCase()? Boolean.TRUE : Boolean.FALSE);
      listingOperator.sort(new Sorting(sc));
    }
View Full Code Here

    final IListingDataProvider dataProvider = accountService.getAccountHistoryDataProvider();

    final Criteria<AccountHistory> criteria = new Criteria<AccountHistory>(AccountHistory.class);
    criteria.getPrimaryGroup().addCriterion("account", new PrimaryKey<Account>(Account.class, account.getId()));

    final Sorting sorting = new Sorting("transDate");

    final IListHandler<SearchResult<?>> lh =
      ListHandlerFactory.create(criteria, sorting, ListHandlerType.PAGE, dataProvider);
    final List<SearchResult<?>> chunk = lh.getElements(0, 25, sorting);
    Assert.assertTrue(chunk != null && chunk.size() == 1);
View Full Code Here

    // iterator through all defined select named queries
    for(final SelectNamedQueries nq : querySortBindings.keySet()) {
      dataProvider = getListHandlerDataProvider((Class<IEntity>) nq.getEntityType());
      criteria = new Criteria<IEntity>(nq, queryParamsBindings.get(nq));
      final Sorting sorting = new Sorting(querySortBindings.get(nq));

      // test for all list handler types
      for(final ListHandlerType lht : ListHandlerType.values()) {
        IListHandler<SearchResult<?>> listHandler = null;
        logger.debug("Validating '" + nq.toString() + "' query with " + lht.toString() + " list handling...");
View Full Code Here

    this.rpcHandler = new RpcUiHandler(this);
    this.auxDataRequest = auxDataRequest;
    this.fldPnlResolver = fldPnlResolver;
    this.deletable = deletable;
    final String listingId = SmbizEntityType.INTERFACE.name();
    final Sorting defaultSorting = new Sorting("name");
    final String[] propKeys = {
      "name", "code", "description"
    };
    listHandler =
      RemoteListingOperator.create(listingId, ListHandlerType.COLLECTION, criteria, propKeys, -1, defaultSorting);
View Full Code Here

   * @return A new {@link RemoteListingDefinition} instance.
   */
  RemoteListingDefinition<TestAddressSearch> getListingDef() {
    final RemoteListingDefinition<TestAddressSearch> def =
      new RemoteListingDefinition<TestAddressSearch>(new TestAddressSearch(), null, 2,
          new Sorting("lastName"));
    return def;
  }
View Full Code Here

    if(ofst < 0 || (!force && ofst > listHandler.size() - 1)) {
      throw new IndexOutOfBoundsException("Listing offset " + ofst + " is out of bounds");
    }

    // do we need to actually re-query?
    final Sorting sorting = getSorting();
    if(!force && elements != null && this.offset == ofst && sorting != null && sorting.equals(srtg)) {
      return;
    }

    // query
    final int psize = pageSize == -1 ? listHandler.size() : pageSize;
View Full Code Here

      }
      else {
        final ListingCache lcache = context.getListingCache();
        assert lcache != null : "Null ListingCache";
        Integer offset = request.getOffset();
        Sorting sorting = request.getSorting();

        // get listing state (if cached)
        final ListingState state = lcache.getState(sessionId, listingId);
        if(state != null) {
          log.debug("Found cached state for listing '{}': {}", listingId, state.toString());
          if(offset == null) {
            offset = state.getOffset();
            assert offset != null;
            log.debug("Setting offset ({}) from cache for listing: {}", offset, listingId);
          }
          if(sorting == null) {
            sorting = state.getSorting();
            assert sorting != null;
            log.debug("Setting sorting ({}) from cache for listing: {}", sorting.toString(), listingId);
          }
        }

        handler = lcache.getHandler(sessionId, listingId);
        listingStatus = (handler == null ? ListingStatus.NOT_CACHED : ListingStatus.CACHED);
View Full Code Here

  public IListHandler<? extends IMarshalable> getRowListHandler(
      RemoteListingDefinition<? extends IMarshalable> listingDef) {
    try {
      // just create a list handler full of test address entities
      Collection<Address> clc = egraph.getEntitiesByType(Address.class);
      IListHandler<Address> lh = ListHandlerFactory.create(clc, new Sorting("address1"));
      return new AddressDtoListHandler(lh);
    }
    catch(Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

TOP

Related Classes of com.tll.dao.Sorting

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.