Practice Assignment
Create a Maven Project
Add the Hibernate, Hibernate Annotations and
MySql dependencies to the POM file Add and
set up the Configuration file
We need a User model class with the following attributes
userId (primary key),
email (unique - so we need a Column annotation where unique = true)
name,
password,
address,
state and
zip code.
Add the constructors, getters and setters.
We also need a controller class with the following methods - login(takes in email and password and checks if they exist and returns true if they do; findByEmail (returns the User using email as a parameter); findUsersByZipcode (returns a list of users using zipcode as the parameter)
Last updated