Can any one help me how to solve these use cases for maker-checker functionality using envers.
1) Maker creates a request to create an entity (eg department) -- Data should not be inserted to entity tables . It has to be recorded in audit tables
2) Chec开发者_JS百科ker retrives list of entities for authorization -- Data should be queried from audit table
3) Checker views the pending request -- Display original record along with changes
4) Checker authorizes the request -- Data is moved/overwrite from audit table to enity table.
5) Maker requests to modify an entity -- Entity tables will not be modified. The changes are recorded in audit tables. Changes will move the entity tables only upon authorization.
The solution is expected to address following constraints
1) Master-Detail ie, Dept contains Employees
2) Bulk authorization , ie, When there are say 10,000 employees in a department the authorization process should have reasonable performance. The final use case has to execute data validations + authorization rules + moving data from audit tables to entity tables.
3) All above use cases apply to Master-Detail.
I like to know from envers experts is it feasible to implement all above usecases using envers ? What changes will be needed in Envers ?
Thanks in advance --Kiran.Kumar
I like to know from envers experts is it feasible to implement all above usecases using envers ?
I'm not an expert regarding Envers, but no, almost none of the cases are doable with Envers. The reason is quite simple: you have too many specific use cases to use a generic solution.
In your position, I would specify an interface, called "Verifiable" (or something like that), which defines an "approvalDate" and "approver". Your business methods would be in charge of retrieving the entities which are not approved yet and deal with them. Just note that it may not be feasible to store entities in one table first, then move entities to another.
精彩评论