问题
I have a JSF datatable, it has three columns, those are:Work_Type_Desc, Project_Phase, and Activity_Desc. Those columns comes from 2 different database tables, the relationship of those two tables are one-to-many.
The 1st Table name is Work_Type. It has 1) Work_Type_Cd, 2)Work_Type_Desc, 3)Created_By_Name, 4)Created_DT, 5)Updated_By_Name, 6) Updated_DT
The 2nd Table name is Activity_Type. It has 1)Activity_Cd,2) Work_Type_Cd,3)Project_Phase,4)Activity_Desc, 5)Created_By_Name, 6)Created_DT, 7)Updated_By_Name, 8) Updated_DT.
I use Hibernate+Spring+JSF, my previous question was how to show those three column records in JSF datatable, it has been solved with the help of a nice guy here, JSF datatable columns from multiple database tables.
Now, I have a new question, I can show all the existing records and add new records in JSF pages now. But have problem when delete and update.Here is my delete code, I already set the cascade as all, because I need to do all CRUD:
adminService.deleteActivity((String[]) dataTable.getRowData()); allActivities = adminService.findAllActivityTypes();
But it doesn't work, do you know how to solve it? Thanks!
来源:https://stackoverflow.com/questions/18541993/delete-jsf-datatable-rowcolumns-in-row-from-different-database