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

Java SystemAccountTypeQuery类代码示例

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

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



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

示例1: executeAction

import nl.strohalm.cyclos.services.accounts.SystemAccountTypeQuery; //导入依赖的package包/类
@Override
protected ActionForward executeAction(final ActionContext context) throws Exception {
    final HttpServletRequest request = context.getRequest();
    final List<AccountType> accountTypes = new ArrayList<AccountType>();
    // Get the system accounts
    final SystemAccountTypeQuery systemQuery = new SystemAccountTypeQuery();
    systemQuery.fetch(AccountType.Relationships.CURRENCY);
    accountTypes.addAll(accountTypeService.search(systemQuery));
    // Get the member accounts
    final MemberAccountTypeQuery memberQuery = new MemberAccountTypeQuery();
    memberQuery.fetch(AccountType.Relationships.CURRENCY);
    accountTypes.addAll(accountTypeService.search(memberQuery));

    request.setAttribute("accountTypes", accountTypes);
    return context.getInputForward();
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:17,代码来源:ListAccountTypesAction.java


示例2: search

import nl.strohalm.cyclos.services.accounts.SystemAccountTypeQuery; //导入依赖的package包/类
@Override
public List<AccountType> search(final AccountTypeQuery query) {
    final Class<? extends AccountType> entityType = (query instanceof SystemAccountTypeQuery) ? SystemAccountType.class : MemberAccountType.class;
    final Map<String, Object> namedParameters = new HashMap<String, Object>();
    final Set<Relationship> fetch = query.getFetch();
    final StringBuilder hql = JpaQueryHelper.getInitialQuery(entityType, "at", fetch);
    JpaQueryHelper.addLikeParameterToQuery(hql, namedParameters, "at.description", query.getDescription());
    JpaQueryHelper.addLikeParameterToQuery(hql, namedParameters, "at.name", query.getName());
    JpaQueryHelper.addParameterToQuery(hql, namedParameters, "at.currency", query.getCurrency());
    // Handle nature-specific parameters
    if (query instanceof SystemAccountTypeQuery) {
        // System accounts
        final SystemAccountTypeQuery systemQuery = (SystemAccountTypeQuery) query;
        if (systemQuery.getLimited() != null) {
            if (systemQuery.getLimited()) {
                hql.append(" and at.account.creditLimit is not null ");
            } else {
                hql.append(" and at.account.creditLimit is null ");
            }
        }
    } else {
        // Member accounts
        final MemberAccountTypeQuery memberQuery = (MemberAccountTypeQuery) query;

        if (memberQuery.getOwner() != null) {
            final Member member = getFetchDao().fetch(memberQuery.getOwner(), Element.Relationships.GROUP);
            memberQuery.setRelatedToGroup(member.getMemberGroup());
        }
        if (memberQuery.getRelatedToGroups() != null && !memberQuery.getRelatedToGroups().isEmpty()) {
            hql.append(" and exists (select mgaso.id from " + MemberGroupAccountSettings.class.getName() + " mgaso where mgaso.group in :relatedGroups and mgaso.accountType = at)");
            namedParameters.put("relatedGroups", memberQuery.getRelatedToGroups());
        }
        if (memberQuery.getNotRelatedToGroups() != null && !memberQuery.getNotRelatedToGroups().isEmpty()) {
            hql.append(" and not exists (select mgaso.id from " + MemberGroupAccountSettings.class.getName() + " mgaso where mgaso.group in :notRelatedGroups and mgaso.accountType = at)");
            namedParameters.put("notRelatedGroups", memberQuery.getNotRelatedToGroups());
        }
    }
    JpaQueryHelper.appendOrder(hql, "at.class", "at.name");
    return list(query, hql.toString(), namedParameters);
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:41,代码来源:AccountTypeDAOImpl.java


示例3: load

import nl.strohalm.cyclos.services.accounts.SystemAccountTypeQuery; //导入依赖的package包/类
private Collection<? extends Entity> load(final CommonDataBean commonData, final AdminSystemPermission permission) {
    switch (permission) {
        case ACCOUNTS_INFORMATION:
            return accountTypeService.search(new SystemAccountTypeQuery());
        case PAYMENTS_PAYMENT:
            // System to system payments
            TransferTypeQuery ttQuery = new TransferTypeQuery();
            ttQuery.setContext(TransactionContext.SELF_PAYMENT);
            ttQuery.setFromNature(AccountType.Nature.SYSTEM);
            ttQuery.setToNature(AccountType.Nature.SYSTEM);
            ttQuery.setFromAccountTypes(commonData.systemAccountTypes);
            ttQuery.setToAccountTypes(commonData.systemAccountTypes);
            return transferTypeService.search(ttQuery);
        case PAYMENTS_CHARGEBACK:
            // System chargebacks
            final TransferTypeQuery systemChargebackQuery = new TransferTypeQuery();
            systemChargebackQuery.setToNature(AccountType.Nature.SYSTEM);
            final List<TransferType> systemChargebacks = transferTypeService.search(systemChargebackQuery);
            for (final Iterator<TransferType> iter = systemChargebacks.iterator(); iter.hasNext();) {
                final TransferType tt = iter.next();
                final Context ctx = tt.getContext();
                if (!ctx.isPayment() && !ctx.isSelfPayment()) {
                    iter.remove();
                }
            }
            return systemChargebacks;
        case STATUS_VIEW_CONNECTED_ADMINS:
            // View connected admins
            GroupQuery groupQuery = new GroupQuery();
            groupQuery.setNatures(Group.Nature.ADMIN);
            return groupService.search(groupQuery);
        default:
            throw new IllegalArgumentException(String.format("Unsupported list permission: %1$s.%2$s", permission.getClass().getSimpleName(), permission));
    }
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:36,代码来源:PermissionCatalogHandlerImpl.java


示例4: search

import nl.strohalm.cyclos.services.accounts.SystemAccountTypeQuery; //导入依赖的package包/类
@Override
public List<AccountType> search(final AccountTypeQuery query) {
    final Class<? extends AccountType> entityType = (query instanceof SystemAccountTypeQuery) ? SystemAccountType.class : MemberAccountType.class;
    final Map<String, Object> namedParameters = new HashMap<String, Object>();
    final Set<Relationship> fetch = query.getFetch();
    final StringBuilder hql = HibernateHelper.getInitialQuery(entityType, "at", fetch);
    HibernateHelper.addLikeParameterToQuery(hql, namedParameters, "at.description", query.getDescription());
    HibernateHelper.addLikeParameterToQuery(hql, namedParameters, "at.name", query.getName());
    HibernateHelper.addParameterToQuery(hql, namedParameters, "at.currency", query.getCurrency());
    // Handle nature-specific parameters
    if (query instanceof SystemAccountTypeQuery) {
        // System accounts
        final SystemAccountTypeQuery systemQuery = (SystemAccountTypeQuery) query;
        if (systemQuery.getLimited() != null) {
            if (systemQuery.getLimited()) {
                hql.append(" and at.account.creditLimit is not null ");
            } else {
                hql.append(" and at.account.creditLimit is null ");
            }
        }
    } else {
        // Member accounts
        final MemberAccountTypeQuery memberQuery = (MemberAccountTypeQuery) query;

        if (memberQuery.getOwner() != null) {
            final Member member = getFetchDao().fetch(memberQuery.getOwner(), Element.Relationships.GROUP);
            memberQuery.setRelatedToGroup(member.getMemberGroup());
        }
        if (memberQuery.getRelatedToGroups() != null && !memberQuery.getRelatedToGroups().isEmpty()) {
            hql.append(" and exists (select mgaso.id from " + MemberGroupAccountSettings.class.getName() + " mgaso where mgaso.group in (:relatedGroups) and mgaso.accountType = at)");
            namedParameters.put("relatedGroups", memberQuery.getRelatedToGroups());
        }
        if (memberQuery.getNotRelatedToGroups() != null && !memberQuery.getNotRelatedToGroups().isEmpty()) {
            hql.append(" and not exists (select mgaso.id from " + MemberGroupAccountSettings.class.getName() + " mgaso where mgaso.group in (:notRelatedGroups) and mgaso.accountType = at)");
            namedParameters.put("notRelatedGroups", memberQuery.getNotRelatedToGroups());
        }
    }
    HibernateHelper.appendOrder(hql, "at.class", "at.name");
    return list(query, hql.toString(), namedParameters);
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:41,代码来源:AccountTypeDAOImpl.java


示例5: prepareForm

import nl.strohalm.cyclos.services.accounts.SystemAccountTypeQuery; //导入依赖的package包/类
@Override
protected QueryParameters prepareForm(final ActionContext context) {
    final SearchScheduledPaymentsForm form = context.getForm();
    final HttpServletRequest request = context.getRequest();

    final ScheduledPaymentQuery query = getDataBinder().readFromString(form.getQuery());
    query.fetch(ScheduledPayment.Relationships.TRANSFERS, RelationshipHelper.nested(Payment.Relationships.FROM, MemberAccount.Relationships.MEMBER), RelationshipHelper.nested(Payment.Relationships.TO, MemberAccount.Relationships.MEMBER));

    // Account owner
    AccountOwner owner = null;
    if (form.getMemberId() > 0) {
        owner = (Member) elementService.load(form.getMemberId());
        request.setAttribute("memberId", form.getMemberId());
    } else {
        // An admin or member or an operator searching his own scheduled payments
        owner = context.getAccountOwner();
    }
    query.setOwner(owner);

    List<? extends AccountType> accountTypes;
    if (context.isAdmin() && owner instanceof SystemAccountOwner) {
        final SystemAccountTypeQuery satq = new SystemAccountTypeQuery();
        accountTypes = accountTypeService.search(satq);
    } else {
        final MemberAccountTypeQuery matq = new MemberAccountTypeQuery();
        matq.setOwner((Member) owner);
        accountTypes = accountTypeService.search(matq);
    }
    request.setAttribute("accountTypes", accountTypes);

    if (query.getMember() != null) {
        final Member member = elementService.load(query.getMember().getId(), Element.Relationships.USER);
        query.setMember(member);
    }
    if (query.getStatusList() == null) {
        query.setStatusGroup(ScheduledPaymentQuery.StatusGroup.OPEN);
        form.setQuery("statusGroup", ScheduledPaymentQuery.StatusGroup.OPEN);
    }

    RequestHelper.storeEnum(request, ScheduledPaymentQuery.SearchType.class, "searchTypes");
    RequestHelper.storeEnum(request, ScheduledPaymentQuery.StatusGroup.class, "statusGroups");
    request.setAttribute("accountOwner", owner);
    return query;
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:45,代码来源:SearchScheduledPaymentsAction.java


示例6: applySystemAccountFilter

import nl.strohalm.cyclos.services.accounts.SystemAccountTypeQuery; //导入依赖的package包/类
/**
 * takes care that the system account filter box filled with appropriate system accounts. Method to be called from the prepareForm method
 * 
 * @param request
 */
protected void applySystemAccountFilter(final HttpServletRequest request) {
    final List<? extends AccountType> systemAccounts = accountTypeService.search(new SystemAccountTypeQuery());
    request.setAttribute("systemAccounts", systemAccounts);
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:10,代码来源:StatisticsAction.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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