BrightSide Workbench Full Report + Source Code
org.turro.erp.workorder.WorkOrderCombobox Class Reference
Inheritance diagram for org.turro.erp.workorder.WorkOrderCombobox:
Collaboration diagram for org.turro.erp.workorder.WorkOrderCombobox:

Public Member Functions

void populateList (String value, LinkedList list, int nRows)
 
String getTextFromObject (WorkOrder value)
 
- Public Member Functions inherited from org.turro.zkoss.input.GenericCombobox< V >
 GenericCombobox ()
 
getObjectValue ()
 
void setObjectValue (V value)
 
boolean isAllowNotInModelValues ()
 
void setAllowNotInModelValues (boolean allowNotInModelValues)
 
void refreshModel ()
 
abstract String getTextFromObject (V value)
 
Object getRelatedEntity ()
 
void setRelatedEntity (Object relatedEntity)
 
void render (Comboitem item, Object data, int index) throws Exception
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 38 of file WorkOrderCombobox.java.

Member Function Documentation

◆ getTextFromObject()

String org.turro.erp.workorder.WorkOrderCombobox.getTextFromObject ( WorkOrder  value)

Definition at line 72 of file WorkOrderCombobox.java.

72  {
73  return value.getWorkOrderId() + " " + value.getSomeDescription().replaceAll("\n", "");
74  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateList()

void org.turro.erp.workorder.WorkOrderCombobox.populateList ( String  value,
LinkedList  list,
int  nRows 
)

Reimplemented from org.turro.zkoss.input.GenericCombobox< V >.

Definition at line 43 of file WorkOrderCombobox.java.

43  {
44  EntityManager em = new ErpPU().getEntityManager();
45  try {
46  WhereClause wc = SQLHelper.getWhereClause(new String[]{
47  "wo.description", "r.description"
48  }, value);
49  Query q = em.createQuery(
50  "select distinct wo from WorkOrder wo " +
51  "left join wo.orderReferences r " +
52  "left join r.tasks t " +
53  "where wo.workOrderId = :woid " +
54  (activeTasks ? "or (t.status <> :status " : "") +
55  wc.getClause() + ")");
56  q.setMaxResults(nRows);
57  wc.addNamedValue("woid", ObjectString.parseString(value, Long.class, true));
58  if(activeTasks) {
59  wc.addNamedValue("status", TaskStatus.TASK_FINISHED);
60  }
61  wc.setNamedParameters(q);
62  List<Resource> l = q.getResultList();
63  for(Object o : l) {
64  list.add(getTextFromObject((WorkOrder) o));
65  }
66  } finally {
67  em.close();
68  }
69  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: