Examples of OrderCriteria


Examples of org.dmlite.model.order.OrderCriteria

    Members orderByLastFirstName = null;
    try {
      CompositeComparator compositePropertyComparator = new CompositeComparator(
          new PropertyComparator("lastName"), new PropertyComparator(
              "firstName"));
      OrderCriteria criteria = OrderCriteria.defineOrder(
          compositePropertyComparator, ascending);
      orderByLastFirstName = (Members) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Members.getMembersOrderedByLastFirstName: "
          + e.getMessage());
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

  public Interests getInterestsOrderedByTopic(boolean ascending) {
    Interests orderByTopic = null;
    try {
      NeighborComparator neighborComparator = new NeighborComparator(
          "topic", "name");
      OrderCriteria criteria = OrderCriteria.defineOrder(
          neighborComparator, ascending);
      orderByTopic = (Interests) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Interests.getOrderByTopic: " + e.getMessage());
    }
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

      CompositeComparator compositePropertyComparator = new CompositeComparator(
          new PropertyComparator("lastName"), new PropertyComparator(
              "firstName"));
      NeighborComparator neighborComparator = new NeighborComparator(
          "user", compositePropertyComparator);
      OrderCriteria criteria = OrderCriteria.defineOrder(
          neighborComparator, ascending);
      orderByUser = (Interests) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Interests.getOrderByUser: " + e.getMessage());
    }
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

  }

  public Entries getEntriesOrderedByCreationDate(boolean ascending) {
    Entries orderByCreationDate = null;
    try {
      OrderCriteria criteria = OrderCriteria.defineOrder("creationDate",
          ascending);
      orderByCreationDate = (Entries) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Entries.getEntriesOrderedByCreationDate: "
          + e.getMessage());
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

   * @return ordered comments
   */
  public Comments getCommentsOrderedByCreationDate(boolean ascending) {
    Comments order = null;
    try {
      OrderCriteria criteria = OrderCriteria.defineOrder("creationDate",
          ascending);
      order = (Comments) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Comments.getCommentsOrderedByCreationDate: "
          + e.getMessage());
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

   * @return ordered comments
   */
  public Comments getCommentsOrderedBySource(boolean ascending) {
    Comments orderBySource = null;
    try {
      OrderCriteria criteria = OrderCriteria.defineOrder("source",
          ascending);
      orderBySource = (Comments) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Comments.getCommentsOrderedBySource: "
          + e.getMessage());
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

   * @return ordered projects
   */
  public Projects getProjectsOrderedBySequence() {
    Projects orderBySequence = null;
    try {
      OrderCriteria criteria = OrderCriteria.defineOrder("sequence");
      orderBySequence = (Projects) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Projects.getProjectsOrderedBySequence: "
          + e.getMessage());
    }
View Full Code Here

Examples of org.dmlite.model.order.OrderCriteria

   * @return ordered spirals
   */
  public Spirals getSpiralsOrderedByCreationDate(boolean ascending) {
    Spirals orderByCreationDate = null;
    try {
      OrderCriteria criteria = OrderCriteria.defineOrder("creationDate",
          ascending);
      orderByCreationDate = (Spirals) getEntities(criteria);
    } catch (OrderException e) {
      log.error("Error in Spirals.getSpiralsOrderedByCreationDate: "
          + e.getMessage());
View Full Code Here

Examples of smilehouse.openinterface.OrderCriteria

        // This component does not support iteration, so we output all our data
        // once (and only once)
        if( this.allDataOutput == true ) return null;
        else this.allDataOutput = true;
       
        OrderCriteria criteria = new OrderCriteria();

        // Date after
        Date dateAfter = getDateAfter();
        if(dateAfter != null) {
            Calendar dateAfterCal = new GregorianCalendar();
            dateAfterCal.setTime(dateAfter);
            criteria.setDateAfter(dateAfterCal);
        }

        // Date before
        Date dateBefore = getDateBefore();
        if(dateBefore != null) {
            Calendar dateBeforeCal = new GregorianCalendar();
            dateBeforeCal.setTime(dateBefore);
            criteria.setDateBefore(dateBeforeCal);
        }

        // Customer id in
        String customerIdInStr = this.data.getAttribute(CUSTOMER_ID_IN_ATTR);
        if(customerIdInStr != null && customerIdInStr.length() > 0)
            criteria.setCustomerIdIn(Utils.split(customerIdInStr, ","));

        // Hanling status in
        String handlingStatusNameInStr = this.data.getAttribute(HANDLING_STATUS_NAME_IN_ATTR);
        if(handlingStatusNameInStr != null && handlingStatusNameInStr.length() > 0)
            criteria.setHandlingStatusNameIn(Utils.split(handlingStatusNameInStr, ","));

        // Handling status not in
        String handlingStatusNameNotInStr = this.data.getAttribute(HANDLING_STATUS_NAME_NOT_IN_ATTR);
        if(handlingStatusNameNotInStr != null && handlingStatusNameNotInStr.length() > 0)
            criteria.setHandlingStatusNameNotIn(Utils.split(handlingStatusNameNotInStr, ","));

        // Payment status in
        String paymentStatusNameInStr = this.data.getAttribute(PAYMENT_STATUS_NAME_IN_ATTR);
        if(paymentStatusNameInStr != null && paymentStatusNameInStr.length() > 0)
            criteria.setPaymentStatusNameIn(Utils.split(paymentStatusNameInStr, ","));

        // Payment status not in
        String paymentStatusNameNotInStr = this.data.getAttribute(PAYMENT_STATUS_NAME_NOT_IN_ATTR);
        if(paymentStatusNameNotInStr != null && paymentStatusNameNotInStr.length() > 0)
            criteria.setPaymentStatusNameNotIn(Utils.split(paymentStatusNameNotInStr, ","));

        // New status
        String newStatusName = this.data.getAttribute(NEW_STATUS_NAME_ATTR);
        if(newStatusName != null && newStatusName.length() == 0)
            newStatusName = null;

        // id greater than
        String idGTStr = this.data.getAttribute(ID_GREATER_THAN_ATTR);
        if(idGTStr != null && idGTStr.length() > 0) {
            try {
                criteria.setIdGreaterThan(new Long(idGTStr));
            } catch(NumberFormatException nfe) {
                logger.logMessage(
                    "Non-numeric value in 'id greater than' criteria",
                    this,
                    MessageLogger.ERROR);
                throw nfe;
            }
        }
        // id less than
        String idLTStr = this.data.getAttribute(ID_LESS_THAN_ATTR);
        if(idLTStr != null && idLTStr.length() > 0) {
            try {
                criteria.setIdLessThan(new Long(idLTStr));
            } catch(NumberFormatException nfe) {
                logger.logMessage(
                    "Non-numeric value in 'id greater than' criteria",
                    this,
                    MessageLogger.ERROR);
                throw nfe;
            }
        }
        // id in
        String idInStr = this.data.getAttribute(ID_IN_ATTR);
        if(idInStr != null && idInStr.length() > 0) {
            String[] idInStrArray = Utils.split(idInStr, ",");
            Long[] idInLongArray = new Long[idInStrArray.length];
            try {
                for(int i = 0; i < idInStrArray.length; i++)
                    idInLongArray[i] = new Long(idInStrArray[i]);
                criteria.setIdIn(idInLongArray);
            } catch(NumberFormatException nfe) {
                logger.logMessage(
                    "Non-numeric value in 'id-in' criteria",
                    this,
                    MessageLogger.ERROR);
                throw nfe;
            }
        }

        // Sum greater than
        Double sumGreaterThan = getSumGreaterThan();
        if(sumGreaterThan != null && !sumGreaterThan.isNaN())
            criteria.setSumGreaterThan(sumGreaterThan);
        // Sum less than
        Double sumLessThan = getSumLessThan();
        if(sumLessThan != null && !sumLessThan.isNaN())
            criteria.setSumLessThan(sumLessThan);

        logger.logMessage("Calling Open Interface", this, MessageLogger.DEBUG);
        try {
            ExportResult result;
           
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.