This repository contains files for my Enterprise Java personal project. Budget Game Rankings will be a web app that grabs data on pricing and ratings for video games and ranks them according to user chosen parameters.
My takeaway is learning even more about Hibernate. I took this time to really try to flesh out how to use the APIs and database. I'm opting to go for minimal database with alot of API as the user explores the app. I think I have an API that will work for both ratings/descriptions and another API for pricing on digital download games at least. The one I was thinking of using for physical copies on ebay and such, is actually not free. About half of the APIs I find aren't free. I also need to decide on a way to generally limit on how many games I search; maybe I can do it by popularity or trending.
A challenge for me was understanding how the entities relate to one another and the relationships I had to define within the Daos and extra variables in the javabeans. I took a long time reading about and fixing some of my criteria statements.
I had a problem with the criteria statements. I had to read the official user guide to understand it better. I also ran into the problem with getting the userId variable from WishedGame entity; I just forgot that I had user instead in the javabean. Hopefully the way I got it in WishedGameDao is fine.
[ ] It's good to see that you were thinking about the different ways you would want to access WishedGames and got some good practice with Criteria. I wonder if you might not need the getByUserId method in the WishedGameDao. Would you be able to get at a user's WishedGames by using the UserDao: use the UserDao to get a user by id, once you have the user, it will automatically have the user's WishedGames set (https://github.com/kileader/Budget-Game-Rankings/blob/66ae239543b441d1d9408e3e5ef6122f55fbc7f6/src/main/java/com/kevinleader/bgr/entity/User.java#L132). THIS is the really slick thing about hibernate!
[ ] You'll likely notice, if you haven't already, that writing a Dao for each entity will be very repetitive - watch for the abstract/generic dao to be introduced in the coming week and plan to use it in your project so that you can use a single dao! It even has a generic getByProperty method that should handle lots of those special cases like getByEmail, getByUserName, etc. Note that you will still have unit tests each for each entity(dao) to make sure that annotations and database relationships are set up correctly.
[ ] Another test case to consider with one-to-many relationships. If you delete a user that has some WishedGames, should those WishedGames be removed too? What if you delete a WishedGame, what happens to the user? Write some tests to verify what you want to happen in these cases actually does happen!
[ ] Regarding APIs - if you discover there's an API that you REALLY want to use and it isn't free, one option would be to use a tool like Mockaroo to mock out that API rather than using the real thing. I just posted the link to Mockaroo in Slack.
@pawaitemadisoncollege week 5 is finished.
My takeaway is learning even more about Hibernate. I took this time to really try to flesh out how to use the APIs and database. I'm opting to go for minimal database with alot of API as the user explores the app. I think I have an API that will work for both ratings/descriptions and another API for pricing on digital download games at least. The one I was thinking of using for physical copies on ebay and such, is actually not free. About half of the APIs I find aren't free. I also need to decide on a way to generally limit on how many games I search; maybe I can do it by popularity or trending.
A challenge for me was understanding how the entities relate to one another and the relationships I had to define within the Daos and extra variables in the javabeans. I took a long time reading about and fixing some of my criteria statements.
I had a problem with the criteria statements. I had to read the official user guide to understand it better. I also ran into the problem with getting the userId variable from WishedGame entity; I just forgot that I had user instead in the javabean. Hopefully the way I got it in WishedGameDao is fine.