Example usage for com.liferay.portal.kernel.dao.orm ProjectionFactoryUtil min

List of usage examples for com.liferay.portal.kernel.dao.orm ProjectionFactoryUtil min

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.orm ProjectionFactoryUtil min.

Prototype

public static Projection min(String propertyName) 

Source Link

Usage

From source file:com.bemis.portal.order.service.impl.OrderRequestLocalServiceImpl.java

License:Open Source License

@Override
public List<Date> getFirstOrderRequestedDate(long orderId) {
    DynamicQuery dynamicQuery = orderRequestLocalService.dynamicQuery();

    ProjectionList projectionList = ProjectionFactoryUtil.projectionList();

    projectionList.add(ProjectionFactoryUtil.min("requestedDate"));

    dynamicQuery = dynamicQuery.setProjection(projectionList);

    Criterion criterion = RestrictionsFactoryUtil.eq("orderId", orderId);

    dynamicQuery.add(criterion);//www.  j av  a2s .  com

    return orderRequestLocalService.dynamicQuery(dynamicQuery);
}

From source file:jorgediazest.util.model.ModelImpl.java

License:Open Source License

protected Projection getPropertyProjection(String attribute, String op) {

    if ("rowCount".equals(op)) {
        return ProjectionFactoryUtil.rowCount();
    }/*www  .  j a  v a  2s.  c o m*/

    if (!this.hasAttribute(attribute)) {
        return null;
    }

    if (isPartOfPrimaryKeyMultiAttribute(attribute)) {
        attribute = "primaryKey." + attribute;
    }

    Projection property = null;

    if (Validator.isNull(op)) {
        property = ProjectionFactoryUtil.property(attribute);
    } else if ("count".equals(op)) {
        property = ProjectionFactoryUtil.count(attribute);
    } else if ("countDistinct".equals(op)) {
        property = ProjectionFactoryUtil.countDistinct(attribute);
    } else if ("groupProperty".equals(op)) {
        property = ProjectionFactoryUtil.groupProperty(attribute);
    } else if ("max".equals(op)) {
        property = ProjectionFactoryUtil.max(attribute);
    } else if ("min".equals(op)) {
        property = ProjectionFactoryUtil.min(attribute);
    } else if ("sum".equals(op)) {
        property = ProjectionFactoryUtil.sum(attribute);
    }

    return property;
}