java - JSF dataTable logic: I am retrieving multiple rows of the same entity from the db; however i want to show only one -


I am retrieving the table of data from my DB that looks:

! [1]:

As you can see that I have same EmpName, EmpID repeating the designation because that is because it There are many tasks allocated. To see that the more rendering is displayed only once, the amplified, the name, the designation are printed and the lines of the remaining special staff are sometimes printed as DB.

My datatable looks like this:

  & lt; H: DataTable value = "# {employeeWiseReportBean.empWiseList}" var = "u" rhythm = 'true' styleClass = "infoTable" headerClass = "DataTable Header" rowClasses = "dataTableRow" & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; Employee ID & lt; / F: Aspect & gt; # {U.empID} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; First name & lt; / F: Aspect & gt; # {U.fullName} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; Designation & lt; / F: Aspect & gt; # {U.designation} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; Work id & lt; / F: Aspect & gt; # {U.subTaskID} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; Job Description & lt; / F: Aspect & gt; # {U.taskDescription} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; & Lt; / f to: Aspect & gt; # {U.fromDate} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; TO & lt; / F: Aspect & gt; # {U.toDate} & lt; / H: column & gt; & Lt; / H: datatable & gt;   

I know why so many examples are being printed, but I do not understand how it prints just one example.

The question I used and the result set is like:

  public list & lt; Employee Definitions & gt; GetEmpWiseDB () {List & lt; EmployeeDutySchedule & gt; EmpDutyList = New Array List & amp; Staff; Employee Deutsche Schadulele & gt; (); Results set rs = null; String Query = "employee_diti_setule.m.p_id, first_name, last_name, amp_design, task_located_id, description, from_data, to_data \ n" + "with transport_simma_scheme employee-information, transport_directory. employee / deputy_squedeledel, transport_department_schema.m_subtasks \ n" + "where employees_information Emp_id = employee_duty_schedule.emp_id and employee_duty_schedule.task_allocated_id = m_subtasks.subtask_id; \ n "+" \ n "+" "; Println (query); Rs = MyQueryExe.executeQuery (query); System.out.println ("RS" + RS); Try {while (rs.next ()) {employee DutySchedule empDuty = new EmployeeDutySchedule (); empDuty.setEmpID (rs.getString ("emp_id")); EmpDuty.setFullName (rs.getString ("first_name") + "" + rsgetstring ("last_name")); EmpDuty.setSubTaskID (rs.getString ("task_allocated_id")); empDuty.setTaskDescription (rs.getString ("Description")); EmpDuty.setDesignation (rs.getString ("emp_designation")); empDuty.setFromDate (rs.getDate ("FROM_DATE")); empDuty.setToDate (rs.getDate ("TO_DATE")); EmpDutyList.add (empDuty); System.out.println ("Size of the list" + empDutyList.size ()); }} Grip (eclipse e) {egetstackTrace (); } Return empDutyList; }   

There are several empID entries to show all the tasks allocated to a particular employee in the database table.

Any help would be appreciated! I hope my question is quite clear thanks.

Do you mean, repeating the header string "employee ID", or Number of rows related to each employee?

In the latter case, try adding different keywords to your query:

  Select different employee employee_schedule.emp_id, ........... .....    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -