当前位置: 首页>>代码示例>>Java>>正文


Java JPAQuery.from方法代码示例

本文整理汇总了Java中com.mysema.query.jpa.impl.JPAQuery.from方法的典型用法代码示例。如果您正苦于以下问题:Java JPAQuery.from方法的具体用法?Java JPAQuery.from怎么用?Java JPAQuery.from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mysema.query.jpa.impl.JPAQuery的用法示例。


在下文中一共展示了JPAQuery.from方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCustomers

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
private Map<Integer, Customer> getCustomers(List<Integer> ids) {
    Map<Integer, Customer> map = new HashMap<>();
    if (ids.isEmpty()) {
        return map;
    }

    QCustomer customer = QCustomer.customer;
    JPAQuery query = new JPAQuery(page.getEntityManager());
    query.from(customer);
    query.where(customer.id.in(ids));

    List<Customer> customers = query.list(customer);
    if (customers == null) {
        return map;
    }

    for (Customer c : customers) {
        map.put(c.getId(), c);
    }

    return map;
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:23,代码来源:SummaryPartsDataProvider.java

示例2: getProjectParts

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
private Map<Integer, Part> getProjectParts(List<Integer> ids) {
    Map<Integer, Part> map = new HashMap<>();
    if (ids.isEmpty()) {
        return map;
    }

    QPart part = QPart.part;
    JPAQuery query = new JPAQuery(page.getEntityManager());
    query.from(part);
    query.where(part.id.in(ids));

    List<Part> parts = query.list(part);
    if (parts == null) {
        return map;
    }

    for (Part p : parts) {
        map.put(p.getId(), p);
    }

    return map;
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:23,代码来源:SummaryPartsDataProvider.java

示例3: checkCreditNote

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public PTCreditNoteEntity checkCreditNote(PTInvoice invoice) {

    QJPAPTCreditNoteEntity creditNoteEntity = QJPAPTCreditNoteEntity.jPAPTCreditNoteEntity;

    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(creditNoteEntity);

    List<JPAPTCreditNoteEntity> allCns = query.list(creditNoteEntity);

    // TODO make a query to do this
    for (JPAPTCreditNoteEntity cne : allCns) {
        for (PTCreditNoteEntry cnee : cne.getEntries()) {
            if (cnee.getReference().getNumber().compareTo(invoice.getNumber()) == 0) {
                return cne;
            }
        }
    }
    return null;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:22,代码来源:DAOPTCreditNoteEntryImpl.java

示例4: checkCreditNote

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public ESCreditNoteEntity checkCreditNote(ESInvoice invoice) {

    QJPAESCreditNoteEntity creditNoteEntity = QJPAESCreditNoteEntity.jPAESCreditNoteEntity;

    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(creditNoteEntity);

    List<JPAESCreditNoteEntity> allCns = query.list(creditNoteEntity);

    // TODO make a query to do this
    for (JPAESCreditNoteEntity cne : allCns) {
        for (ESCreditNoteEntry cnee : cne.getEntries()) {
            if (cnee.getReference().getNumber().compareTo(invoice.getNumber()) == 0) {
                return cne;
            }
        }
    }
    return null;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:22,代码来源:DAOESCreditNoteEntryImpl.java

示例5: checkCreditReceipt

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public ESCreditReceiptEntity checkCreditReceipt(ESReceipt receipt) {

    QJPAESCreditReceiptEntity creditReceiptEntity = QJPAESCreditReceiptEntity.jPAESCreditReceiptEntity;

    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(creditReceiptEntity);

    List<JPAESCreditReceiptEntity> allCns = query.list(creditReceiptEntity);

    // TODO make a query to do this
    for (JPAESCreditReceiptEntity cne : allCns) {
        for (ESCreditReceiptEntry cnee : cne.getEntries()) {
            if (cnee.getReference().getNumber().compareTo(receipt.getNumber()) == 0) {
                return cne;
            }
        }
    }
    return null;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:22,代码来源:DAOESCreditReceiptEntryImpl.java

示例6: checkCreditNote

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public FRCreditNoteEntity checkCreditNote(FRInvoice invoice) {

    QJPAFRCreditNoteEntity creditNoteEntity = QJPAFRCreditNoteEntity.jPAFRCreditNoteEntity;

    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(creditNoteEntity);

    List<JPAFRCreditNoteEntity> allCns = query.list(creditNoteEntity);

    // TODO make a query to do this
    for (JPAFRCreditNoteEntity cne : allCns) {
        for (FRCreditNoteEntry cnee : cne.getEntries()) {
            if (cnee.getReference().getNumber().compareTo(invoice.getNumber()) == 0) {
                return cne;
            }
        }
    }
    return null;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:22,代码来源:DAOFRCreditNoteEntryImpl.java

示例7: checkCreditReceipt

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public FRCreditReceiptEntity checkCreditReceipt(FRReceipt receipt) {

    QJPAFRCreditReceiptEntity creditReceiptEntity = QJPAFRCreditReceiptEntity.jPAFRCreditReceiptEntity;

    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(creditReceiptEntity);

    List<JPAFRCreditReceiptEntity> allCns = query.list(creditReceiptEntity);

    // TODO make a query to do this
    for (JPAFRCreditReceiptEntity cne : allCns) {
        for (FRCreditReceiptEntry cnee : cne.getEntries()) {
            if (cnee.getReference().getNumber().compareTo(receipt.getNumber()) == 0) {
                return cne;
            }
        }
    }
    return null;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:22,代码来源:DAOFRCreditReceiptEntryImpl.java

示例8: getTaxes

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public List<JPAPTTaxEntity> getTaxes(PTRegionContextEntity context, Date validFrom, Date validTo) {

    QJPAPTTaxEntity tax = QJPAPTTaxEntity.jPAPTTaxEntity;
    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(tax);
    List<BooleanExpression> predicates = new ArrayList<>();
    BooleanExpression validFromPredicate = tax.validFrom.eq(validFrom);
    predicates.add(validFromPredicate);
    BooleanExpression validToPredicate = tax.validTo.eq(validTo);
    predicates.add(validToPredicate);
    BooleanExpression lessOrEqual = tax.validTo.loe(validFrom);
    predicates.add(lessOrEqual);
    BooleanExpression active = tax.active.eq(true);
    predicates.add(active);
    BooleanExpression contextPredicate = tax.context.eq(context);
    predicates.add(contextPredicate);

    for (BooleanExpression e : predicates) {
        query.where(e);
    }

    List<JPAPTTaxEntity> list = null;
    list = query.list(tax);
    if (context.getParentContext() != null) {
        list.addAll(this.getTaxes((PTRegionContextEntity) context.getParentContext(), validFrom, validTo));
    }
    return list;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:31,代码来源:DAOPTTaxImpl.java

示例9: getTaxes

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public List<JPAESTaxEntity> getTaxes(ESRegionContextEntity context, Date validFrom, Date validTo) {

    QJPAESTaxEntity tax = QJPAESTaxEntity.jPAESTaxEntity;
    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(tax);
    List<BooleanExpression> predicates = new ArrayList<>();
    BooleanExpression validFromPredicate = tax.validFrom.eq(validFrom);
    predicates.add(validFromPredicate);
    BooleanExpression validToPredicate = tax.validTo.eq(validTo);
    predicates.add(validToPredicate);
    BooleanExpression lessOrEqual = tax.validTo.loe(validFrom);
    predicates.add(lessOrEqual);
    BooleanExpression active = tax.active.eq(true);
    predicates.add(active);
    BooleanExpression contextPredicate = tax.context.eq(context);
    predicates.add(contextPredicate);

    for (BooleanExpression e : predicates) {
        query.where(e);
    }

    List<JPAESTaxEntity> list = null;
    list = query.list(tax);
    if (context.getParentContext() != null) {
        list.addAll(this.getTaxes((ESRegionContextEntity) context.getParentContext(), validFrom, validTo));
    }
    return list;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:31,代码来源:DAOESTaxImpl.java

示例10: getTaxes

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public List<JPAFRTaxEntity> getTaxes(FRRegionContextEntity context, Date validFrom, Date validTo) {

    QJPAFRTaxEntity tax = QJPAFRTaxEntity.jPAFRTaxEntity;
    JPAQuery query = new JPAQuery(this.getEntityManager());

    query.from(tax);
    List<BooleanExpression> predicates = new ArrayList<>();
    BooleanExpression validFromPredicate = tax.validFrom.eq(validFrom);
    predicates.add(validFromPredicate);
    BooleanExpression validToPredicate = tax.validTo.eq(validTo);
    predicates.add(validToPredicate);
    BooleanExpression lessOrEqual = tax.validTo.loe(validFrom);
    predicates.add(lessOrEqual);
    BooleanExpression active = tax.active.eq(true);
    predicates.add(active);
    BooleanExpression contextPredicate = tax.context.eq(context);
    predicates.add(contextPredicate);

    for (BooleanExpression e : predicates) {
        query.where(e);
    }

    List<JPAFRTaxEntity> list = null;
    list = query.list(tax);
    if (context.getParentContext() != null) {
        list.addAll(this.getTaxes((FRRegionContextEntity) context.getParentContext(), validFrom, validTo));
    }
    return list;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:31,代码来源:DAOFRTaxImpl.java

示例11: getTaxesForSAFTPT

import com.mysema.query.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public List<JPAPTTaxEntity> getTaxesForSAFTPT(PTRegionContextEntity context, Date validFrom, Date validTo) {
    QJPAPTTaxEntity tax = QJPAPTTaxEntity.jPAPTTaxEntity;
    JPAQuery query = new JPAQuery(this.getEntityManager());

    List<BooleanExpression> predicates = new ArrayList<>();
    BooleanExpression active = tax.active.eq(true);
    predicates.add(active);
    BooleanExpression regionContext = tax.context.eq(context);
    predicates.add(regionContext);
    if (validFrom != null) {
        BooleanExpression dateFrom = tax.validFrom.eq(validFrom);
        predicates.add(dateFrom);
    }

    if (validTo != null) {
        BooleanExpression dateTo = tax.validTo.eq(validTo);
        predicates.add(dateTo);
    }

    query.from(tax);
    for (BooleanExpression e : predicates) {
        query.where(e);
    }
    List<JPAPTTaxEntity> list = query.list(tax);
    List<JPAPTRegionContextEntity> childContexts = null;
    List<JPAPTTaxEntity> taxResult = null;
    List<JPAPTTaxEntity> taxContextResult = new ArrayList<>();

    for (JPAPTTaxEntity t : list) {
        childContexts = this.getChildContexts((PTRegionContextEntity) t.getContext());
        for (JPAPTRegionContextEntity c : childContexts) {
            taxResult = this.getTaxesForSAFTPT(c, validFrom, validTo);
            if (taxResult != null) {
                taxContextResult.addAll(taxResult);
            }
        }
    }
    if (taxContextResult != null) {
        list.addAll(taxContextResult);
    }
    return list;
}
 
开发者ID:premium-minds,项目名称:billy,代码行数:44,代码来源:DAOPTTaxImpl.java


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