18 package org.turro.erp.humanres;
20 import java.util.LinkedList;
21 import java.util.List;
22 import javax.persistence.EntityManager;
23 import javax.persistence.Query;
24 import org.turro.elephant.db.SQLHelper;
25 import org.turro.elephant.db.WhereClause;
26 import org.turro.erp.db.ErpPU;
27 import org.turro.erp.entity.HumanResource;
28 import org.turro.hr.humanres.HumanResources;
29 import org.turro.zkoss.input.GenericCombobox;
30 import org.zkoss.zk.ui.event.Event;
31 import org.zkoss.zk.ui.event.Events;
32 import org.zkoss.zk.ui.ext.AfterCompose;
40 private boolean onlyActive =
true;
41 private boolean selectCurrent =
false;
48 this.onlyActive = onlyActive;
56 this.selectCurrent = selectCurrent;
60 public void populateList(String value, LinkedList list,
int nRows) {
66 Query q = em.createQuery(
67 "select res from HumanResource res " +
68 "where active = :active " +
73 q.setMaxResults(nRows);
75 List<HumanResource> l = q.getResultList();
93 Events.postEvent(
new Event(Events.ON_CHANGE,
this));
static WhereClause getWhereClause(String[] fields, String value)
void setNamedParameters(Query q)
void addNamedValue(String name, Object value)
void populateList(String value, LinkedList list, int nRows)
String getTextFromObject(HumanResource value)
boolean isSelectCurrent()
void setSelectCurrent(boolean selectCurrent)
void setOnlyActive(boolean onlyActive)
static HumanResource getCurrent()
EntityManager getEntityManager()