Hi
I have an application in which I have 4 entities User, Group, Message and Ticket each entity has an id that is being generated by their corresponding sequences. I'm using JPA with Hibernate.
The application is working fine. Now I need to make few changes in this application:Code:@Entity class User extends SomeClassA{ @Id @GeneratedValue(generator="seqUser") int userId; ... other fields, getter and setters .... } @Entity class Group extends SomeClassB{ @Id @GeneratedValue(generator="seqGrp") int groupId; ... other fields, getter and setters .... } @Entity class Message extends SomeClassC{ @Id @GeneratedValue(generator="seqMsg") int msgId; ... other fields, getter and setters .... } @Entity class Ticket extends SomeClassD{ @Id @GeneratedValue(generator="seqTic") int ticId; ... other fields, getter and setters .... }
1. Each Message and Ticket needs to be approved.
2. There can be multiple approvers for each Message/Ticket.
3. Each User/Group will have an approval queue.
I've thought of implementing the changes as follows:
1. User and Group will implement interface 'Approver'.
2. Message and Ticket will implement interface 'Approvable'.
3. User and Group will have a List<Approvable> approvalQueue;
4. Message and Ticket will have a List<Approver> approvers;
Can anyone help me understand how this can be done?
Thanks
Amit Khanna


Reply With Quote
