• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExpressionList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.avaje.ebean.ExpressionList的典型用法代码示例。如果您正苦于以下问题:Java ExpressionList类的具体用法?Java ExpressionList怎么用?Java ExpressionList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExpressionList类属于com.avaje.ebean包,在下文中一共展示了ExpressionList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPEPlanAllocatedActorAsExprByActorAndActive

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all allocation of an actor for not archived portfolio entries as an
 * expression list.
 *
 * @param actorId
 *            the actor id
 * @param activeOnly
 *            if true, it returns only the allocation for which the end date
 *            is in the future
 */
public static ExpressionList<PortfolioEntryResourcePlanAllocatedActor> getPEPlanAllocatedActorAsExprByActorAndActive(Long actorId, boolean activeOnly, boolean withArchived) {

    ExpressionList<PortfolioEntryResourcePlanAllocatedActor> expr = PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedActor.orderBy("endDate")
            .where().eq("deleted", false).eq("actor.id", actorId).eq("portfolioEntryResourcePlan.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.isFrozen", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.isActive", true)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.deleted", false);

    if (!withArchived) {
        expr = expr.add(Expr.eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.archived", false));
    }

    if (activeOnly) {
        expr = expr.add(Expr.or(Expr.isNull("endDate"), Expr.gt("endDate", new Date())));
    }

    return expr;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:31,代码来源:PortfolioEntryResourcePlanDAO.java


示例2: getPEPlanAllocatedActorAsExprByManager

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all allocation of the actors from the given manager for not archived
 * portfolio entries, as an expression list.
 *
 * @param actorId
 *            the manager id
 * @param activeOnly
 *            if true, it returns only the allocation for which the end date
 *            is in the future
 */
public static ExpressionList<PortfolioEntryResourcePlanAllocatedActor> getPEPlanAllocatedActorAsExprByManager(Long actorId, boolean activeOnly) {

    ExpressionList<PortfolioEntryResourcePlanAllocatedActor> expr = PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedActor.where()
            .eq("deleted", false).eq("actor.isActive", true).eq("actor.deleted", false).eq("actor.manager.id", actorId)
            .eq("portfolioEntryResourcePlan.deleted", false).eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.isFrozen", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.isActive", true)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.archived", false);

    if (activeOnly) {
        expr = expr.add(Expr.or(Expr.isNull("endDate"), Expr.gt("endDate", new Date())));
    }

    return expr;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:28,代码来源:PortfolioEntryResourcePlanDAO.java


示例3: getPEPlanAllocatedActorAsListByPE

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the actor allocations for a portfolio entry according to some
 * filters.
 *
 * @param portfolioEntryId
 *            the portfolio entry id
 * @param start
 *            the startDate or the endDate should be after this date
 * @param end
 *            the startDate or the endDate should be before this date
 * @param onlyConfirmed
 *            if true, then return only the confirmed allocations
 * @param orgUnitId
 *            the org unit id
 * @param competencyId
 *            the competency id (for the default)
 */
public static List<PortfolioEntryResourcePlanAllocatedActor> getPEPlanAllocatedActorAsListByPE(Long portfolioEntryId, Date start, Date end,
        boolean onlyConfirmed, Long orgUnitId, Long competencyId) {
    ExpressionList<PortfolioEntryResourcePlanAllocatedActor> exprAllocatedActors = PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedActor
            .fetch("actor").fetch("actor.orgUnit").where()
            .eq("deleted", false).isNotNull("startDate").isNotNull("endDate").le("startDate", end).ge("endDate", start)
            .eq("portfolioEntryResourcePlan.deleted", false).eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.isFrozen", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.isActive", true)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.id", portfolioEntryId);
    if (onlyConfirmed) {
        exprAllocatedActors = exprAllocatedActors.eq("portfolioEntryResourcePlanAllocationStatusType.status", PortfolioEntryResourcePlanAllocationStatusType.AllocationStatus.CONFIRMED);
    }
    if (orgUnitId != null) {
        exprAllocatedActors = exprAllocatedActors.eq("actor.orgUnit.id", orgUnitId);
    }
    if (competencyId != null) {
        exprAllocatedActors = exprAllocatedActors.eq("actor.defaultCompetency.id", competencyId);
    }
    return exprAllocatedActors.findList();
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:39,代码来源:PortfolioEntryResourcePlanDAO.java


示例4: getPEPlanAllocatedCompetencyAsListByPE

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the competencies allocations for a portfolio entry according to some
 * filters.
 *
 * @param portfolioEntryId
 *            the portfolio entry id
 * @param start
 *            the startDate or the endDate should be after this date
 * @param end
 *            the startDate or the endDate should be before this date
 * @param onlyConfirmed
 *            if true, then return only the confirmed allocations
 * @param competencyId
 *            the competency id
 */
public static List<PortfolioEntryResourcePlanAllocatedCompetency> getPEPlanAllocatedCompetencyAsListByPE(Long portfolioEntryId, Date start, Date end,
        boolean onlyConfirmed, Long competencyId) {
    ExpressionList<PortfolioEntryResourcePlanAllocatedCompetency> exprAllocatedCompetencies = PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedCompetency
            .where().eq("deleted", false).isNotNull("startDate").isNotNull("endDate").le("startDate", end).ge("endDate", start)
            .eq("portfolioEntryResourcePlan.deleted", false).eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.isFrozen", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.isActive", true)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.id", portfolioEntryId);
    if (onlyConfirmed) {
        exprAllocatedCompetencies = exprAllocatedCompetencies.eq("portfolioEntryResourcePlanAllocationStatusType.name", PortfolioEntryResourcePlanAllocationStatusType.AllocationStatus.CONFIRMED);
    }
    if (competencyId != null) {
        exprAllocatedCompetencies = exprAllocatedCompetencies.eq("competency.id", competencyId);
    }
    return exprAllocatedCompetencies.findList();
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:33,代码来源:PortfolioEntryResourcePlanDAO.java


示例5: getPEResourcePlanAllocatedOrgUnitAsExprByOrgUnit

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all allocation of an org unit for not archived portfolio entries as
 * an expression list.
 *
 * @param orgUnitId
 *            the org unit id
 * @param activeOnly
 *            if true, it returns only the allocation for which the end date
 *            is in the future
 */
public static ExpressionList<PortfolioEntryResourcePlanAllocatedOrgUnit> getPEResourcePlanAllocatedOrgUnitAsExprByOrgUnit(Long orgUnitId,
        boolean activeOnly, boolean draftExcluded) {

    ExpressionList<PortfolioEntryResourcePlanAllocatedOrgUnit> expr = PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedOrgUnit.orderBy("endDate")
            .where().eq("deleted", false).eq("orgUnit.id", orgUnitId).eq("portfolioEntryResourcePlan.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.isFrozen", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.isActive", true)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.deleted", false)
            .eq("portfolioEntryResourcePlan.lifeCycleInstancePlannings.lifeCycleInstance.portfolioEntry.archived", false);

    if (activeOnly) {
        expr = expr.add(Expr.or(Expr.isNull("endDate"), Expr.gt("endDate", new Date())));
    }

    if (draftExcluded) {
        expr = expr.not(Expr.eq("portfolioEntryResourcePlanAllocationStatusType", PortfolioEntryResourcePlanDAO.getAllocationStatusByType(PortfolioEntryResourcePlanAllocationStatusType.AllocationStatus.DRAFT)));
    }

    return expr;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:33,代码来源:PortfolioEntryResourcePlanDAO.java


示例6: getActorAsListByFilter

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the actors list with filters.
 * 
 * @param isActive
 *            true to return only active actors, false only non-active, null
 *            all.
 * @param managerId
 *            if not null then return only actors with the given manager.
 * @param actorTypeId
 *            if not null then return only actors with the given type.
 * @param competencyId
 *            if not null then return only actors with the given competency.
 * @param orgUnitId
 *            if not null then return only actors with the given org unit.
 */
public static List<Actor> getActorAsListByFilter(Boolean isActive, Long managerId, Long actorTypeId, Long competencyId, Long orgUnitId) {
    ExpressionList<Actor> e = findActor.where().eq("deleted", false);
    if (isActive != null) {
        e = e.eq("isActive", isActive);
    }
    if (managerId != null) {
        e = e.eq("manager.id", managerId);
    }
    if (actorTypeId != null) {
        e = e.eq("actorType.id", actorTypeId);
    }
    if (competencyId != null) {
        e = e.eq("competencies.id", competencyId);
    }
    if (orgUnitId != null) {
        e = e.eq("orgUnit.id", orgUnitId);
    }

    return e.findList();
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:36,代码来源:ActorDao.java


示例7: getStakeholderAsListByFilter

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the stakeholders list with filters.
 * 
 * @param actorId
 *            if not null then return only stakeholders associated the given
 *            actor.
 * @param portfolioId
 *            if not null then return only stakeholders associated the given
 *            portfolio.
 * @param portfolioEntryId
 *            if not null then return only stakeholders associated the given
 *            portfolio entry.
 * @param stakeholderTypeId
 *            if not null then return only stakeholders with the given type.
 */
public static List<Stakeholder> getStakeholderAsListByFilter(Long actorId, Long portfolioId, Long portfolioEntryId, Long stakeholderTypeId) {

    ExpressionList<Stakeholder> e = findStakeholder.where().eq("deleted", false);

    if (actorId != null) {
        e = e.eq("actor.id", actorId);
    }
    if (portfolioId != null) {
        e = e.eq("portfolio.id", portfolioId);
    }
    if (portfolioEntryId != null) {
        e = e.eq("portfolioEntry.id", portfolioEntryId);
    }
    if (stakeholderTypeId != null) {
        e = e.eq("stakeholderType.id", stakeholderTypeId);
    }

    return e.findList();
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:35,代码来源:StakeholderDao.java


示例8: getPortfolioAsListByFilter

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the portfolios list with filter.
 * 
 * @param isActive
 *            true to return only active portfolios, false only non-active,
 *            null all.
 * @param managerId
 *            if not null then return only portfolios with the given
 *            manager.
 * @param portfolioEntryId
 *            if not null then return only portfolios containing the given
 *            portfolio entry.
 * @param portfolioTypeId
 *            if not null then return only portfolios with the given type.
 */
public static List<Portfolio> getPortfolioAsListByFilter(Boolean isActive, Long managerId, Long portfolioEntryId, Long portfolioTypeId) {

    ExpressionList<Portfolio> e = findPortfolio.where().eq("deleted", false);
    if (isActive != null) {
        e = e.eq("isActive", isActive);
    }
    if (managerId != null) {
        e = e.eq("manager.id", managerId);
    }
    if (portfolioEntryId != null) {
        e = e.eq("portfolioEntries.id", portfolioEntryId);
    }
    if (portfolioTypeId != null) {
        e = e.eq("portfolioType.id", portfolioTypeId);
    }

    return e.findList();

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:35,代码来源:PortfolioDao.java


示例9: getTimesheetsTable

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the timesheet entries table for a portfolio entry and a filter
 * config.
 * 
 * @param portfolioEntryId
 *            the portfolio entry id
 * @param filterConfig
 *            the filter config.
 */
private Pair<Table<TimesheetLogListView>, Pagination<TimesheetLog>> getTimesheetsTable(Long portfolioEntryId,
        FilterConfig<TimesheetLogListView> filterConfig) {

    ExpressionList<TimesheetLog> expressionList = filterConfig
            .updateWithSearchExpression(TimesheetDao.getTimesheetLogAsExprByPortfolioEntry(portfolioEntryId));
    filterConfig.updateWithSortExpression(expressionList);

    Pagination<TimesheetLog> pagination = new Pagination<TimesheetLog>(this.getPreferenceManagerPlugin(), expressionList);
    pagination.setCurrentPage(filterConfig.getCurrentPage());

    List<TimesheetLogListView> timesheetLogListView = new ArrayList<TimesheetLogListView>();
    for (TimesheetLog timesheetLog : pagination.getListOfObjects()) {
        timesheetLogListView.add(new TimesheetLogListView(timesheetLog));
    }

    Set<String> columnsToHide = filterConfig.getColumnsToHide();

    Table<TimesheetLogListView> table = this.getTableProvider().get().timesheetLog.templateTable.fillForFilterConfig(timesheetLogListView, columnsToHide);

    return Pair.of(table, pagination);

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:32,代码来源:PortfolioEntryStatusReportingController.java


示例10: getApplicationBlocksTable

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the application blocks table with filtering capabilities.
 * 
 * @param filterConfig
 *            the filter config.
 */
private Pair<Table<ApplicationBlockListView>, Pagination<ApplicationBlock>> getApplicationBlocksTable(
        FilterConfig<ApplicationBlockListView> filterConfig) {

    ExpressionList<ApplicationBlock> expressionList = filterConfig.updateWithSearchExpression(ArchitectureDao.getApplicationBlockAsExpr());
    filterConfig.updateWithSortExpression(expressionList);

    Pagination<ApplicationBlock> pagination = new Pagination<ApplicationBlock>(this.getPreferenceManagerPlugin(), expressionList);
    pagination.setCurrentPage(filterConfig.getCurrentPage());

    List<ApplicationBlockListView> listView = new ArrayList<ApplicationBlockListView>();
    for (ApplicationBlock applicationBlock : pagination.getListOfObjects()) {
        listView.add(new ApplicationBlockListView(applicationBlock));
    }

    Table<ApplicationBlockListView> table = this.getTableProvider().get().applicationBlock.templateTable.fillForFilterConfig(listView,
            filterConfig.getColumnsToHide());

    return Pair.of(table, pagination);

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:27,代码来源:ArchitectureController.java


示例11: getIterationsTable

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get the iterations table for a portfolio entry and a filter config.
 * 
 * @param portfolioEntryId
 *            the portfolio entry id
 * @param filterConfig
 *            the filter config.
 */
private Pair<Table<IterationListView>, Pagination<Iteration>> getIterationsTable(Long portfolioEntryId, FilterConfig<IterationListView> filterConfig) {

    ExpressionList<Iteration> expressionList = filterConfig.updateWithSearchExpression(IterationDAO.getIterationAllAsExprByPE(portfolioEntryId));
    filterConfig.updateWithSortExpression(expressionList);

    Pagination<Iteration> pagination = new Pagination<Iteration>(this.getPreferenceManagerPlugin(), expressionList);
    pagination.setCurrentPage(filterConfig.getCurrentPage());

    List<IterationListView> iterationListView = new ArrayList<IterationListView>();
    for (Iteration iteration : pagination.getListOfObjects()) {
        iterationListView.add(new IterationListView(iteration));
    }

    Set<String> hideColumns = filterConfig.getColumnsToHide();
    if (!getSecurityService().dynamic("PORTFOLIO_ENTRY_EDIT_DYNAMIC_PERMISSION", "")) {
        hideColumns.add("editActionLink");
    }

    Table<IterationListView> table = this.getTableProvider().get().iteration.templateTable.fillForFilterConfig(iterationListView, hideColumns);

    return Pair.of(table, pagination);

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:32,代码来源:PortfolioEntryDeliveryController.java


示例12: getPortfolioEntryActorAllocationIds

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all delivery unit allocation ids according to the current
 * filter configuration.
 *
 * @param id the resource plan id
 */
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_DETAILS_DYNAMIC_PERMISSION)
public Result getPortfolioEntryActorAllocationIds(Long resourcePlanId) {
    String uid = getUserSessionManagerPlugin().getUserSessionId(ctx());

    FilterConfig<PortfolioEntryResourcePlanAllocatedActorListView> filterConfig = this.getTableProvider().get().portfolioEntryResourcePlanAllocatedActor.filterConfig.persistCurrentInDefault(uid, request());
    ExpressionList<PortfolioEntryResourcePlanAllocatedActor> expressionList = filterConfig.updateWithSearchExpression(PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedActor
            .where()
            .eq("deleted", false)
            .eq("portfolioEntryResourcePlan.id", resourcePlanId)
    );

    List<String> ids = expressionList.findList().stream().map(list -> String.valueOf(list.id)).collect(Collectors.toList());

    ObjectMapper mapper = new ObjectMapper();
    JsonNode jsonNode = mapper.valueToTree(ids);

    return ok(jsonNode);
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:25,代码来源:PortfolioEntryPlanningController.java


示例13: getDeliveryUnitAllocationIds

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all delivery unit allocation ids according to the current
 * filter configuration.
 *
 * @param id the resource plan id
 */
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_DETAILS_DYNAMIC_PERMISSION)
public Result getDeliveryUnitAllocationIds(Long resourcePlanId) {
    String uid = getUserSessionManagerPlugin().getUserSessionId(ctx());

    FilterConfig<PortfolioEntryResourcePlanAllocatedOrgUnitListView> filterConfig = this.getTableProvider().get().portfolioEntryResourcePlanAllocatedOrgUnit.filterConfig.persistCurrentInDefault(uid, request());
    ExpressionList<PortfolioEntryResourcePlanAllocatedOrgUnit> expressionList = filterConfig.updateWithSearchExpression(PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedOrgUnit
            .fetch("orgUnit")
            .where()
            .eq("deleted", false)
            .eq("portfolioEntryResourcePlan.id", resourcePlanId)
    );

    List<String> ids = expressionList.findList().stream().map(list -> String.valueOf(list.id)).collect(Collectors.toList());

    ObjectMapper mapper = new ObjectMapper();
    JsonNode jsonNode = mapper.valueToTree(ids);

    return ok(jsonNode);
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:26,代码来源:PortfolioEntryPlanningController.java


示例14: getCompetencyAllocationIds

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all compentency allocation ids according to the current
 * filter configuration.
 *
 * @param id the resource plan id
 */
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_DETAILS_DYNAMIC_PERMISSION)
public Result getCompetencyAllocationIds(Long resourcePlanId) {
    String uid = getUserSessionManagerPlugin().getUserSessionId(ctx());

    FilterConfig<PortfolioEntryResourcePlanAllocatedCompetencyListView> filterConfig = this.getTableProvider().get().portfolioEntryResourcePlanAllocatedCompetency.filterConfig.persistCurrentInDefault(uid, request());
    ExpressionList<PortfolioEntryResourcePlanAllocatedCompetency> expressionList = filterConfig.updateWithSearchExpression(PortfolioEntryResourcePlanDAO.findPEResourcePlanAllocatedCompetency
            .where()
            .eq("deleted", false)
            .eq("portfolioEntryResourcePlan.id", resourcePlanId)
    );

    List<String> ids = expressionList.findList().stream().map(list -> String.valueOf(list.id)).collect(Collectors.toList());

    ObjectMapper mapper = new ObjectMapper();
    JsonNode jsonNode = mapper.valueToTree(ids);

    return ok(jsonNode);
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:25,代码来源:PortfolioEntryPlanningController.java


示例15: getDeliveryUnitAllocationIds

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Get all actors portfolio entry allocation ids according to the current
 * filter configuration.
 * 
 * @param id
 *            the org unit id
 */
@Dynamic(IMafConstants.ORG_UNIT_VIEW_DYNAMIC_PERMISSION)
public Result getDeliveryUnitAllocationIds(Long id) {

    try {

        // get the uid of the current user
        String uid = getUserSessionManagerPlugin().getUserSessionId(ctx());

        // fill the filter config
        FilterConfig<OrgUnitAllocationRequestListView> filterConfig = this.getTableProvider()
                .get().orgUnitAllocationRequest.filterConfig.persistCurrentInDefault(uid, request());

        ExpressionList<PortfolioEntryResourcePlanAllocatedOrgUnit> expressionList = filterConfig.updateWithSearchExpression(PortfolioEntryResourcePlanDAO.getPEResourcePlanAllocatedOrgUnitAsExprByOrgUnit(id, true, true));

        List<String> ids = expressionList.findList().stream().map(list -> String.valueOf(list.id)).collect(Collectors.toList());

        ObjectMapper mapper = new ObjectMapper();
        JsonNode node = mapper.valueToTree(ids);

        return ok(node);

    } catch (Exception e) {
        return internalServerError();
    }
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:33,代码来源:OrgUnitController.java


示例16: getAll

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
@Authentication({User.Role.ADMIN, User.Role.READONLY_ADMIN})
public static Result getAll() {
    ExpressionList<Basestation> exp = QueryHelper.buildQuery(Basestation.class, Basestation.FIND.where());

    List<JsonHelper.Tuple> tuples = exp.findList().stream().map(basestation -> new JsonHelper.Tuple(basestation, new ControllerHelper.Link("self",
            controllers.routes.BasestationController.get(basestation.getId()).absoluteURL(request())))).collect(Collectors.toList());

    // TODO: add links when available
    List<ControllerHelper.Link> links = new ArrayList<>();
    links.add(new ControllerHelper.Link("self", controllers.routes.BasestationController.getAll().absoluteURL(request())));
    links.add(new ControllerHelper.Link("total", controllers.routes.BasestationController.getTotal().absoluteURL(request())));

    try {
        JsonNode result = JsonHelper.createJsonNode(tuples, links, Basestation.class);
        String[] totalQuery = request().queryString().get("total");
        if (totalQuery != null && totalQuery.length == 1 && totalQuery[0].equals("true")) {
            ExpressionList<Basestation> countExpression = QueryHelper.buildQuery(Basestation.class, Basestation.FIND.where(), true);
            String root = Basestation.class.getAnnotation(JsonRootName.class).value();
            ((ObjectNode) result.get(root)).put("total",countExpression.findRowCount());
        }
        return ok(result);
    } catch(JsonProcessingException ex) {
        play.Logger.error(ex.getMessage(), ex);
        return internalServerError();
    }
}
 
开发者ID:ugent-cros,项目名称:cros-core,代码行数:27,代码来源:BasestationController.java


示例17: getAll

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
@Authentication({User.Role.READONLY_ADMIN, User.Role.ADMIN})
public static Result getAll() {
    ExpressionList<Assignment> exp = QueryHelper.buildQuery(Assignment.class, Assignment.FIND.where());

    List<JsonHelper.Tuple> tuples = exp.findList().stream().map(assignment -> new JsonHelper.Tuple(assignment, new ControllerHelper.Link("self",
            controllers.routes.AssignmentController.get(assignment.getId()).absoluteURL(request())))).collect(Collectors.toList());

    // TODO: add links when available
    List<ControllerHelper.Link> links = new ArrayList<>();
    links.add(new ControllerHelper.Link("self", controllers.routes.AssignmentController.getAll().absoluteURL(request())));
    links.add(new ControllerHelper.Link("total", controllers.routes.AssignmentController.getTotal().absoluteURL(request())));

    try {
        JsonNode result = JsonHelper.createJsonNode(tuples, links, Assignment.class);
        String[] totalQuery = request().queryString().get("total");
        if (totalQuery != null && totalQuery.length == 1 && totalQuery[0].equals("true")) {
            ExpressionList<Assignment> countExpression = QueryHelper.buildQuery(Assignment.class, Assignment.FIND.where(), true);
            String root = Assignment.class.getAnnotation(JsonRootName.class).value();
            ((ObjectNode) result.get(root)).put("total",countExpression.findRowCount());
        }
        return ok(result);
    } catch(JsonProcessingException ex) {
        play.Logger.error(ex.getMessage(), ex);
        return internalServerError();
    }
}
 
开发者ID:ugent-cros,项目名称:cros-core,代码行数:27,代码来源:AssignmentController.java


示例18: findByProperties

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * This method search in the database looking for a unique object using the
 * key and the value.
 * @param keys
 * @param values
 * @return dAttributePermission
 * @throws java.lang.Exception 
 */
public static CourseSession findByProperties(List<String> keys, List<Object> values)  
    throws Exception {
    
    ExpressionList<CourseSession> expList = finder.where();
        
    for(int i = 0; i < keys.size(); i++){
        expList.eq(keys.get(i), values.get(i));
    }
    return expList.findUnique();         
}
 
开发者ID:ejesposito,项目名称:CS6310O01,代码行数:19,代码来源:CourseSession.java


示例19: existsByAuthUserIdentity

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
public static boolean existsByAuthUserIdentity(
		final AuthUserIdentity identity) {
	final ExpressionList<User> exp;
	if (identity instanceof UsernamePasswordAuthUser) {
		exp = getUsernamePasswordAuthUserFind((UsernamePasswordAuthUser) identity);
	} else {
		exp = getAuthUserFind(identity);
	}
	return exp.findRowCount() > 0;
}
 
开发者ID:Vadus,项目名称:songs_play,代码行数:11,代码来源:User.java


示例20: generateUserApplicationSummaryQuery

import com.avaje.ebean.ExpressionList; //导入依赖的package包/类
/**
 * Generates the query for returning the application summaries
 * @param usernames The list of usernames
 * @param searchParams Any additional parameters
 * @param sortKey The key on which the applications should be sorted
 * @param increasing The boolean value to sort the output based on the key desc or increasing
 * @return The Query object based on the given above parameters
 */
public static Query<AppResult> generateUserApplicationSummaryQuery(List<String> usernames,
    Map<String, String> searchParams, String sortKey, boolean increasing) {
  ExpressionList<AppResult> query = AppResult.find.select(AppResult.getSearchFields()).where();
  Junction<AppResult> junction = query.disjunction();
  for (String username : usernames) {
    junction.eq(AppResult.TABLE.USERNAME, username);
  }
  query.endJunction();

  String finishedTimeBegin = searchParams.get(Application.FINISHED_TIME_BEGIN);
  if (!Utils.isSet(finishedTimeBegin)) {
    finishedTimeBegin = String.valueOf(System.currentTimeMillis() - 7 * DAY); // week of data if not specified
  }

  long time = parseTime(finishedTimeBegin);
  if (time > 0) {
    query.ge(AppResult.TABLE.FINISH_TIME, time);
  }

  String finishedTimeEnd = searchParams.get(Application.FINISHED_TIME_END);
  if (!Utils.isSet(finishedTimeEnd)) {
    finishedTimeEnd = String.valueOf(System.currentTimeMillis());
  }

  time = parseTime(finishedTimeEnd);
  if (time > 0) {
    query.le(AppResult.TABLE.FINISH_TIME, time);
  }

  if (increasing) {
    return query.order(getSortKey(sortKey));
  } else {
    return query.order().desc(getSortKey(sortKey));
  }
}
 
开发者ID:linkedin,项目名称:dr-elephant,代码行数:44,代码来源:Web.java



注:本文中的com.avaje.ebean.ExpressionList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FeatureMapUtil类代码示例发布时间:2022-05-22
下一篇:
Java EmptyIterator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap