Exercise Solutions: The Early Bird gets the ORM!¶
Here is an example of how the README may turn out:
Our
Personclass might hold the following fields:
id(int) - the unique user ID
firstName(String) - the user’s first name
lastName(String) - the user’s last name
String) - the user’s email, which will also function as their username
password(String) - the user’s passwordThe class would need getters for all of these fields. It could have setters for all fields except id (since it shouldn’t change).
The
Personclass might also have the following references:
PersonProfile- a class to gather up all of the profile information about the user
List<Events> eventsAttending- to store events the user wants to attend
List<Events> eventsOwned- a different list, to store the events the user has created
Personwould have a many-to-many relationship withEventviaList<Events> eventsAttending. It would have a one-to-many relationship withEventviaList<Events> eventsOwned.
