Search (UI) on employee table with the department name and not department ID

最后都变了- 提交于 2019-12-13 03:27:21

问题


Say I have two tables Employee and Department. Employee table has departmentID which references the Department table.

I would like to implement search functionality on the employee table based on EmployeeName and DepartmentName. I've implemented the search on EmployeeName by adding a view criteria on the Employee VO. How do I search department name if I can only add departmentID in the view criteria.

I don't want to search with department ID since my users wont know the IDs of each department but they do know the name.


回答1:


"How do I search department name if I can only add departmentID in the view criteria?"

I assume you can only add departmentID because it's the only attribute of your View Object. Here it look like you are confusing view object and entity object in oracle adf.

In oracle ADF your Entity object will map your database object. So in your case you'll have 2 Entity Object, one for the employee table and another for the department table.

Your View Object here can join both Entity Object Value. So in your case you'll create a view object that is base on your Employee and Department Entity Object with a correct join on your departmentID attribute.

This View Object now have all the attributes from both Entity Object (and Table) so you can create a View Criteria with the attribute you are interessted in.



来源:https://stackoverflow.com/questions/57588685/search-ui-on-employee-table-with-the-department-name-and-not-department-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!