Notes - acbarker42/lpb-recipes GitHub Wiki

-Initially just tried to get a basic Hibernate example I found online of a user registration page that submitted data from the input fields to the database.
-Database connection and session factory info was in hibernate.cfg.xml
-Database mapping was in user.hbm.xml
-Got it working both connecting to local MySQL db and AWS RDS
-Took a while to get the hibernate/session factory/transaction code correct. I was using old example with deprecated setup and finally found examples to work from in the latest release files (duh).

-Added Recipe mapping configuration xml and java object/Controller/DAO files
-Thought I had a hard time adding a second mapping resource, turns out I'd made a copy of the user xml to update with recipe info but forgot to actually open the newly created recipe xml, so user xml had recipe stuff and nothing made sense.
-Created a HibernateUtil file to consolidate some of the common chunks of code I was calling for every transaction.

-Came to a point where it seemed like it made more sense to build the site using both Spring and Hibernate.
-Started with just getting a page to list recipes.
-Had a Recipe, RecipeController, RecipeService, RecipeServiceImpl, RecipeDAO, RecipeDAOImpl, and .jsp to show recipes
-Configuration now housed in web.xml and lazypaleobaker.xml
-web.xml set up Spring's dispatcherServlet to handle all requests and pointed to the lazypalebaker.xml config file
-lazypaleobaker.xml
-configured for component scanning (@Repository, @Controller, @Service, @Component) in com.lazypaleobaker to register with bean factory
-configured support for annotations
-created and defined a view resolver bean
-created and defined a database data source bean using the connection info from the hibernate.cfg.xml
-created and defined a hibernate session factory bean
-created and defined a hibernate transaction manager bean and enabled transaction annotations
-added location for additional resources (.css/.js/.img/etc. files)
-This made the object to db mapping easier by allowing hibernate annotations right in the class instead of in an xml file
-@Autowired allowed for depedency injection of beans that are living in the application context

-Added the rest of the CRUD functionality
-Added author classes and CRUD functionality
-Got the many to one/one to many mapping working between author and recipe
-Big push to get .war deployed on AWS. Realized I needed to restructure the file structure of project. Decided to add Maven at this time for depedency management. Created POM.xml file
-Had to transfer over lazypaleobaker.com domain to AWS, create new DNS records, and point to the Elastic IP address associated with my application environment
-Finally got it working on AWS Elastic beanstalk talking to my Amazon RDS
-Added some javascript, css, navigation, and more jsps
-Got basic spring security working to intercept requests to recipe management pages
-Added loginController, custom login pages, logout functionality