Create OrganizationUserFactory.java
Look at SsuFactory for an example on how to do this, and what methods to add.
We need the following:
The class must extend IDatabaseFactory with OrganizationUser type and OrgUserPostData type.You will have to create OrgUserPostData.java.
The purpose of creating this datahandler class(OrgUserPostData.java) is to have everything declared as string so its easier to send/receive through the controllers.
For example, SSU has a java.sql.data field; so we create SsuPostData.java to declare all the fields as string so we can user that class to map the POST data we receive into a SsuPostData object using @RequestBody annotation. (Look at the AddSsu method inside SsuControllers.java).
Just like that, you must create a OrgUserPostData.java where all the fields from OrganizationUser.java is declared as Strings.
Implement all the methods declared by the Interface.
/**
* @return List<T> of all the T objects in database
*/
List<T> getAllFromDatabase();
/**
* @param id
* @return one T object with unique id
*/
T getById(String id);
/**
* @param postData
* @return id of the new object created.
*/
String insertToDatabase(S postData);
Create OrganizationUserFactory.java Look at SsuFactory for an example on how to do this, and what methods to add.
We need the following:
The class must extend IDatabaseFactory with OrganizationUser type and OrgUserPostData type. You will have to create OrgUserPostData.java. The purpose of creating this datahandler class(OrgUserPostData.java) is to have everything declared as string so its easier to send/receive through the controllers. For example, SSU has a java.sql.data field; so we create SsuPostData.java to declare all the fields as string so we can user that class to map the POST data we receive into a SsuPostData object using @RequestBody annotation. (Look at the AddSsu method inside SsuControllers.java).
Just like that, you must create a OrgUserPostData.java where all the fields from OrganizationUser.java is declared as Strings.
Implement all the methods declared by the Interface.