使用部门名称而不是部门 ID 在员工表上搜索 (UI) [英] Search (UI) on employee table with the department name and not department ID
问题描述
假设我有两个表员工和部门.员工表具有引用部门表的部门 ID.
Say I have two tables Employee and Department. Employee table has departmentID which references the Department table.
我想根据 EmployeeName 和 DepartmentName 在员工表上实现搜索功能.我通过在 Employee VO 上添加一个视图条件来实现对 EmployeeName 的搜索.如果我只能在查看条件中添加部门 ID,如何搜索部门名称.
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.
我不想用部门 ID 进行搜索,因为我的用户不知道每个部门的 ID,但他们知道名称.
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.
推荐答案
"如果只能在查看条件中添加departmentID,如何查找部门名称?"
"How do I search department name if I can only add departmentID in the view criteria?"
我假设您只能添加部门 ID,因为它是您的视图对象的唯一属性.在这里,您似乎混淆了 oracle adf 中的视图对象和实体对象.
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.
在 oracle ADF 中,您的实体对象将映射您的数据库对象.因此,在您的情况下,您将有 2 个实体对象,一个用于员工表,另一个用于部门表.
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.
您在此处的视图对象可以加入两个实体对象值.因此,在您的情况下,您将创建一个视图对象,该对象基于您的 Employee 和 Department 实体对象,并正确连接您的 DepartmentID 属性.
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.
这篇关于使用部门名称而不是部门 ID 在员工表上搜索 (UI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!