本文整理汇总了Java中com.avaje.ebean.ExpressionList类的典型用法代码示例。如果您正苦于以下问题:Java ExpressionList类的具体用法?Java ExpressionList怎么用?Java ExpressionList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionList类属于com.avaje.ebean包,在下文中一共展示了ExpressionList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}