[jboss-user] [JBoss Seam] - Self-referencing foreign keys

markfoerstein do-not-reply at jboss.com
Mon Jul 17 01:04:33 EDT 2006


I used the CRUD generator to create an app based on the Employees table provided by Oracle. After a few adjustments, I got it working pretty nice.

This table has a foreign key (manager_id) that references the primary key of the same table (employee_id). That is, an employee can manage many employees (one-to-many) and this very same employee can be managed by another employee (many-to-one).

In the application, I can successfully:
- Search for existing employees.
- Create/Update/Delete employees.
- Select a manager for an existing employee or when creating a new employee.

The problem I will describe could be easily solved by getting rid of the "View Manager", "View Employee" and "Create Employee" buttons shown in the figure. But I would like to know if there is a possible solution.

http://images.tigratuning.com.br/misc/seamapp.jpg

When I click one of these buttons, essentially what happens on all of them is that I need to get a new editor for a employee different than the one I'm currently editing.

I can't use the same employeeEditor, because I will certainly get a concurrent call exception.

There's no way to create editors for the manager or managed employee, since, well, you can imagine where this would take us... an endless mess.

Is there a way out of this? Any possible solution?

Thanks in advance.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958366#3958366

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958366



More information about the jboss-user mailing list