本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}