本文整理汇总了Java中com.avaje.ebean.ExpressionList.eq方法的典型用法代码示例。如果您正苦于以下问题:Java ExpressionList.eq方法的具体用法?Java ExpressionList.eq怎么用?Java ExpressionList.eq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avaje.ebean.ExpressionList
的用法示例。
在下文中一共展示了ExpressionList.eq方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: getCompetencyAsListByFilter
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the competencies list with filters.
*
* @param isActive
* true to return only active type, false only non-active, null
* all.
* @param actorId
* if not null then return only competencies for the given actor.
*/
public static List<Competency> getCompetencyAsListByFilter(Boolean isActive, Long actorId) {
ExpressionList<Competency> e = findCompetency.where().eq("deleted", false);
if (isActive != null) {
e = e.eq("isActive", isActive);
}
if (actorId != null) {
e = e.eq("actors.id", actorId);
}
return e.findList();
}
示例5: getPEEventTypeActiveAsList
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get all active portfolio entry event types.
*/
public static List<PortfolioEntryEventType> getPEEventTypeActiveAsList(boolean withReadOnly) {
ExpressionList<PortfolioEntryEventType> query = findPortfolioEntryEventType.where().eq("deleted", false).eq("selectable", true);
if (!withReadOnly) {
query.eq("readOnly", false);
}
return query.findList();
}
示例6: getPEIssueAsPaginationByPE
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get all issues of a portfolio entry.
*
* @param portfolioEntryId
* the portfolio entry id
* @param viewAll
* set to true if the inactive entries must be also returned
*/
public static Pagination<PortfolioEntryRisk> getPEIssueAsPaginationByPE(Long portfolioEntryId, Boolean viewAll) {
ExpressionList<PortfolioEntryRisk> e =
findPortfolioEntryRisk.where().eq("deleted", false).eq("portfolio_entry_id", portfolioEntryId).eq("has_occured", true);
if (!viewAll) {
e.eq("is_active", true);
}
e.orderBy("creation_date DESC");
return new Pagination<>(e, 5, Play.application().configuration().getInt("maf.number_page_links"));
}
示例7: getRequirementAsOpenDefectCountByPE
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the total number of open and direct defects of a portfolio entry.
*
* @param portfolioEntryId
* the portfolio entry id
* @param isBlocker
* if true: get only blocker defects, if false: get only
* non-blocker defects, if null: get all defects
*/
public static Integer getRequirementAsOpenDefectCountByPE(Long portfolioEntryId, Boolean isBlocker) {
ExpressionList<Requirement> expr = RequirementDAO.findRequirement.where().eq("deleted", false).eq("portfolioEntry.id", portfolioEntryId)
.eq("isDefect", true).ne("requirementStatus.type", RequirementStatus.Type.CLOSED)
.ne("requirementStatus.type", RequirementStatus.Type.DEPLOYED);
if (isBlocker != null) {
expr = expr.eq("requirementSeverity.isBlocker", isBlocker);
}
return expr.findRowCount();
}
示例8: getRequirementAsCountByPEAndIsScoped
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the total number of direct requirements of a portfolio entry
* according to the isScoped value.
*
* @param portfolioEntryId
* the portfolio entry id
* @param isScoped
* if true: get only the scoped requirements, if false: get only
* the non-scoped requirements, if null: get all requirements
*/
public static Integer getRequirementAsCountByPEAndIsScoped(Long portfolioEntryId, Boolean isScoped) {
ExpressionList<Requirement> expr = RequirementDAO.findRequirement.where().eq("deleted", false).eq("portfolioEntry.id", portfolioEntryId);
if (isScoped != null) {
expr = expr.eq("isScoped", isScoped);
}
return expr.findRowCount();
}
示例9: getBudgetBucketAsListByActiveAndApproved
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the budget buckets list with filter.
*
* @param isActive
* filter on BudgetBucketDAO active flag
* @param isApproved
* filter on BudgetBucketDAO approved flag
**/
public static List<BudgetBucket> getBudgetBucketAsListByActiveAndApproved(Boolean isActive, Boolean isApproved) {
ExpressionList<BudgetBucket> e = BudgetBucketDAO.findBudgetBucket.where().eq("deleted", false);
if (isActive != null) {
e = e.eq("isActive", isActive);
}
if (isApproved != null) {
e = e.eq("isApproved", isApproved);
}
return e.findList();
}
示例10: getActorCapacityAsListByFilter
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the actor capacities list with filters.
*
* @param actorId
* if not null then return only actor capacities for the given
* actor.
* @param year
* if not null then return only actor capacities with the given
* year.
*/
public static List<ActorCapacity> getActorCapacityAsListByFilter(Long actorId, Integer year) {
ExpressionList<ActorCapacity> e = findActorCapacity.where().eq("deleted", false);
if (actorId != null) {
e = e.eq("actor.id", actorId);
}
if (year != null) {
e = e.eq("year", year);
}
return e.findList();
}
示例11: getPEAsListByFilter
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the portfolio entries list with filter.
*
* @param managerId
* if not null then return only portfolio entries for the given
* manager.
* @param sponsoringUnitId
* if not null then return only portfolio entries with the given
* sponsoring unit.
* @param deliveryUnitId
* if not null then return only portfolio entries with the given
* delivery unit.
* @param portfolioId
* if not null then return only portfolio entries belonging to
* the given portfolio.
* @param archived
* true to return only archived portfolio entries, false only
* active, null all.
* @param portfolioEntryTypeId
* if not null then return only portfolio entries with the given
* type.
* @param isPublic
* true to return only public portfolio entries, false only
* confidential, null all.
*/
public static List<PortfolioEntry> getPEAsListByFilter(Long managerId, Long sponsoringUnitId, Long deliveryUnitId, Long portfolioId, Boolean archived,
Long portfolioEntryTypeId, Boolean isPublic) {
ExpressionList<PortfolioEntry> e = findPortfolioEntry.where().eq("deleted", false);
if (managerId != null) {
e = e.eq("manager.id", managerId);
}
if (sponsoringUnitId != null) {
e = e.eq("sponsoringUnit.id", sponsoringUnitId);
}
if (deliveryUnitId != null) {
e = e.eq("deliveryUnits.id", deliveryUnitId);
}
if (portfolioId != null) {
e = e.eq("portfolios.id", portfolioId);
}
if (archived != null) {
e = e.eq("archived", archived);
}
if (portfolioEntryTypeId != null) {
e = e.eq("portfolioEntryType.id", portfolioEntryTypeId);
}
if (isPublic != null) {
e = e.eq("isPublic", isPublic);
}
return e.findList();
}
示例12: getPEAsExpr
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get all portfolio entries as expression.
*
* @param viewArchived
* set to true if the archived entries must be also returned
*/
public static ExpressionList<PortfolioEntry> getPEAsExpr(boolean viewArchived) {
ExpressionList<PortfolioEntry> e = findPortfolioEntry.where().eq("deleted", false);
if (!viewArchived) {
e = e.eq("archived", false);
}
return e;
}
示例13: getOrgUnitAsListByFilter
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the org units list with filters.
*
* @param isActive
* true to return only active org units, false only non-active,
* null all.
* @param managerId
* if not null then return only org units with the given manager.
* @param parentId
* if not null then return only org units with the given parent.
* @param orgUnitTypeId
* if not null then return only org units with the given type.
* @param canSponsor
* if not null then return only sponsoring units.
* @param canDeliver
* if not null then return only delivery units.
**/
public static List<OrgUnit> getOrgUnitAsListByFilter(Boolean isActive, Long managerId, Long parentId, Long orgUnitTypeId, Boolean canSponsor,
Boolean canDeliver) {
ExpressionList<OrgUnit> e = findOrgUnit.where().eq("deleted", false);
if (isActive != null) {
e = e.eq("isActive", isActive);
}
if (managerId != null) {
e = e.eq("manager.id", managerId);
}
if (parentId != null) {
e = e.eq("parent.id", parentId);
}
if (orgUnitTypeId != null) {
e = e.eq("orgUnitType.id", orgUnitTypeId);
}
if (canSponsor != null) {
e = e.eq("canSponsor", canSponsor);
}
if (canDeliver != null) {
e = e.eq("canDeliver", canDeliver);
}
return e.findList();
}
示例14: getPortfolioEntriesViewAllowedAsQuery
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the ebean expression list for all authorized portfolio entries of the
* sign-in user. It's possible to filter and sort the list.
*
* @param expression
* the ebean filter expression
* @param securityService
* the security service
*/
public static ExpressionList<PortfolioEntry> getPortfolioEntriesViewAllowedAsQuery(ISecurityService securityService) throws AccountManagementException {
IUserAccount userAccount = securityService.getCurrentUser();
String raw = "(";
// user has permission PORTFOLIO_ENTRY_VIEW_DETAILS_ALL_PERMISSION
// OR
if (securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_VIEW_DETAILS_ALL_PERMISSION, userAccount)) {
raw += "1 = '1' OR ";
}
// user has permission PORTFOLIO_ENTRY_VIEW_PUBLIC_PERMISSION
// AND portfolioEntry is public AND portfolioEntry is not a concept
// OR
if (securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_VIEW_PUBLIC_PERMISSION, userAccount)) {
raw += "(isPublic=true AND activeLifeCycleInstance.isConcept=false) OR ";
}
Actor actor = ActorDao.getActorByUid(userAccount.getIdentifier());
if (actor != null) {
// user has permission
// PORTFOLIO_ENTRY_VIEW_DETAILS_AS_MANAGER_PERMISSION AND
// user is manager of the portfolioEntry OR
if (securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_VIEW_DETAILS_AS_MANAGER_PERMISSION, userAccount)) {
raw += "manager.id=" + actor.id + " OR ";
}
// user has permission
// PORTFOLIO_ENTRY_VIEW_DETAILS_AS_STAKEHOLDER_PERMISSION AND
// user is direct stakeholder of the portfolioEntry
if (securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_VIEW_DETAILS_AS_STAKEHOLDER_PERMISSION, userAccount)) {
raw += "(stakeholders.deleted=false AND stakeholders.actor.id=" + actor.id + ") OR ";
}
// user has permission
// PORTFOLIO_ENTRY_VIEW_DETAILS_AS_STAKEHOLDER_PERMISSION AND
// user is stakeholder of a portfolio of the portfolioEntry
if (securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_VIEW_DETAILS_AS_STAKEHOLDER_PERMISSION, userAccount)) {
raw += "(portfolios.deleted=false AND portfolios.stakeholders.deleted=false AND portfolios.stakeholders.actor.id=" + actor.id + ") OR ";
}
// user has permission
// PORTFOLIO_ENTRY_VIEW_DETAILS_AS_PORTFOLIO_MANAGER_PERMISSION
// AND
// user
// is portfolio manager of the portfolioEntry
if (securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_VIEW_DETAILS_AS_PORTFOLIO_MANAGER_PERMISSION, userAccount)) {
raw += "(portfolios.deleted=false AND portfolios.manager.id=" + actor.id + ") OR ";
}
}
raw += "1 = '0')";
ExpressionList<PortfolioEntry> expressionList = PortfolioEntryDao.findPortfolioEntry.where();
expressionList = expressionList.eq("deleted", false);
return expressionList.raw(raw);
}
示例15: getActorsViewAllowedAsQuery
import com.avaje.ebean.ExpressionList; //导入方法依赖的package包/类
/**
* Get the ebean expression list for all authorized actors of the sign-in
* user. It's possible to filter and sort the list.
*
* @param expression
* the ebean filter expression
* @param orderBy
* the ebean order by
* @param securityService
* the security service
*/
public static ExpressionList<Actor> getActorsViewAllowedAsQuery(Expression expression, OrderBy<Actor> orderBy, ISecurityService securityService)
throws AccountManagementException {
IUserAccount currentUserAccount = securityService.getCurrentUser();
String raw = "(";
// user has permission ACTOR_VIEW_ALL_PERMISSION
// OR
if (securityService.restrict(IMafConstants.ACTOR_VIEW_ALL_PERMISSION, currentUserAccount)) {
raw += "1 = '1' OR ";
}
Actor actor = ActorDao.getActorByUid(currentUserAccount.getIdentifier());
if (actor != null) {
// the actor "is" the user
raw += "id = " + actor.id + " OR ";
// user has permission
// ACTOR_VIEW_AS_SUPERIOR_PERMISSION AND
// user or his subordinates is manager of the actor OR
if (securityService.restrict(IMafConstants.ACTOR_VIEW_AS_SUPERIOR_PERMISSION, currentUserAccount)) {
raw += "manager.id = " + actor.id + " OR ";
String subordinatesString = ActorHierarchy.getSubordinatesAsString(actor.id, ",");
if (subordinatesString != null && !subordinatesString.trim().isEmpty()) {
raw += "manager.id IN (" + subordinatesString + ") OR ";
}
}
}
raw += "1 = '0')";
ExpressionList<Actor> expressionList;
if (orderBy != null) {
expressionList = ActorDao.findActor.where();
Utilities.updateExpressionListWithOrderBy(orderBy, expressionList);
} else {
expressionList = ActorDao.findActor.where();
}
expressionList = expressionList.eq("deleted", false);
if (expression != null) {
return expressionList.add(expression).raw(raw);
} else {
return expressionList.raw(raw);
}
}