The following tasks are part of milestone 3 and relate to the pages that you have worked on in this lab:
The "All" category.
You will need to add another button/link to the products page (if you haven't already got an All button/link) that will display all of the products when a user clicks it. The existing getAllProducts
function can be used as the click handler for this button/link.
Add a customer table to the database.
The customer ID field should be used as the primary key and should be generated by the database using an auto_increment
integer. Refer to lecture 8, slide 18 for more details. Note that you can use integer
--- there is no need for bigint
as shown in the lecture, particularly since your customer domain's equivalent field is also an integer.
The username should have a unique constraint. Refer to lecture 8, slide 13 for more details.
Create a persistent DAO for customers using JDBI.
The saveCustomer
method should not attempt to save the customer ID --- it is generated by the database.
The validateCredentials
method needs an SQL query that returns a Boolean
. See reference section <> for the details of how to do this.
Your Jooby customer module should be switched to using the persistent customer DAO.