Obtain a set from the query in hibernate. The set contains arrays.

Source: Internet
Author: User

[Html]
Public List getProcessByTaskName (String taskName) throws Exception {
String hql = "select t, p. qType, p. ruleCount from QueueTaskProcess t, QueueProcess p" +
"Where t. processName = p. processName and t. taskName =? Order by t. processIndex ";
List list = this. getEntityManager (). find (hql, new Object [] {taskName });
Return list;
}
At the control layer:
[Html]
@ RequestMapping (value = "searchTProcess", method = RequestMethod. POST)
Public ModelAndView searchTaskProcess (HttpServletRequest request) throws Exception {
ModelAndView mav1 = new ModelAndView ("queue/task/queueTaskProcessList ");
String taskName = Escape. unescape (request. getParameter ("taskName"). trim ());
List taskProcessList = qTaskProcessService. getTaskProcess (taskName );
Mav1.addObject ("taskProcessList", taskProcessList );
Mav1.addObject ("taskName", taskName );
Return mav1;
}

Page:
[Html]
<C: forEach items = "$ {taskProcessList}" var = "queueTaskProcess" varStatus = "">
<Tr class = "tr_bg" id = "<c: out value =" $ {queueTaskProcess [0]. id} "/>">
<Td>
<Input type = "checkbox" name = "processItem" value = "<c: out value =" $ {queueTaskProcess [0]. id} "/>"/> </td>
<Td>
<Div class = "taskProcessTip" tip = "$ {queueTaskProcess [0]. taskName}">
<Span>
<C: out value = "$ {fn: substring (queueTaskProcess [0]. taskName, 0, 20)}"/>
<C: if test = "$ {fn: length (queueTaskProcess [0]. taskName)> 20}">
...
</C: if>
</Span>
</Div>
</Span> </td>
<Td> <span> <c: out value = "$ {queueTaskProcess [0]. processIndex}"/> </span> </td>
<Td>
<Div class = "processListTip" tip = "$ {queueTaskProcess [0]. processName}">
<Span>
<C: out value = "$ {fn: substring (queueTaskProcess [0]. processName, 0, 20)}"/>
<C: if test = "$ {fn: length (queueTaskProcess [0]. processName)> 20}">
...
</C: if>
</Span>
</Div>
</Td>
<Td> <span> <c: out value = "$ {queueTaskProcess [1]}"/> <span> </td>
<Td> <span> <c: out value = "$ {queueTaskProcess [0]. office}"/> </span> </td>
<Td> <span> <c: out value = "$ {queueTaskProcess [2]}"/> </span> </td>
<Td style = "cursor: pointer;" onclick = "showRule ('$ {queueTaskProcess [0]. processName} ',' $ {queueTaskProcess [1]} ') "> <span> <font style =" color: # 1C86EE; "> click to view </font> </span> </td>
<Td id = "taskStatus _ $ {queueTaskProcess [0]. id} "style =" cursor: pointer; "onclick =" modifyProcessStatus ('$ {queueTaskProcess [0]. id} ') ">
<C: if test = "$ {queueTaskProcess [0]. status = 0} "> <font style =" color: red; "> <c: out value =" disabled "/> </font> </c: if>
<C: if test = "$ {queueTaskProcess [0]. status = 1} "> <font style =" color: #228B22; "> <c: out value =" enable "/> </font> </c: if>
</Td>
<Td>
<Div class = "q_up" onclick = "modifyProcessIndex ($ {queueTaskProcess [0]. processIndex}, 'up')"> </div>
<Div class = "q_down" onclick = "modifyProcessIndex ($ {queueTaskProcess [0]. processIndex}, 'drop')"> </div>
</Td>
</Tr>
</C: forEach>

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.