18 package org.turro.financials.product;
20 import java.util.LinkedList;
21 import org.turro.string.Strings;
22 import org.turro.elephant.db.WhereClause;
23 import org.turro.financials.db.FinancialsPU;
24 import org.turro.financials.entity.Contract;
25 import org.turro.financials.entity.Product;
26 import org.turro.financials.entity.ProductByContractor;
27 import org.turro.jpa.Dao;
28 import org.turro.zkoss.input.GenericCombobox;
63 public void populateList(String value, LinkedList list,
int nRows) {
66 wc.
addClause(
"select pbp from ProductByContractor as pbp");
67 wc.
addClause(
"where pbp.contract = :contract");
70 if(!Strings.isBlank(value)) {
72 wc.
addLikeFields(
new String[] {
"pbp.product.description" }, value);
75 wc.
addClause(
"pbp.contractorCode = :pcode");
79 wc.
addClause(
"and pbp.product = :product");
82 wc.
addClause(
"order by pbp.product.description");
83 for(Object o : dao.getResultList(wc, nRows)) {
void setPrefix(String prefix)
void addClause(String clause)
void addLikeFields(String[] fields, String value)
void addNamedValue(String name, Object value)
String getContractorCode()
void populateList(String value, LinkedList list, int nRows)
ProductByContractorCombobox(Contract contract)
void setContract(Contract contract)
void setProduct(Product product)
String getTextFromObject(ProductByContractor value)
ProductByContractorCombobox()