03 JPA Relations
- Friday exercise review. Prepare a short presentation of your solution to the Friday exercise.
- Agree among the team members who should present their solution.
JPA relations first 3 videos. In the video about 1:1 relations Jon refers to an IntelliJ template that a student has made. The template contains a projects setup with HibernateConfig and pom.xml ready made. Fast food for the people ;-) However, the link given in the video is not active anymore. But use these instructions instead, use the one we have done in class - or start from scratch with this JPA project setup.
- Continue working on your portfolio project. Add JPA relations to your project. Use java interfaces to declare the DAO methods that you will need for CRUD operations and for the JPQL queries that you will need for your project. Implement the DAO methods and test them as you go along.
- Remember to keep the relationships as simple as possible and be conservative with the use of cascade types. You can always add more cascade types later on if you need them. Also, think about whether you need bi-directional relationships or if unidirectional relationships are enough for your use case. Remember that you can always add more relationships later on if you need them.
- Implement some JPQL queries to get data from the database. Be creative and try to get data from the database in different ways. You can use the JPQL queries to get data by joining different entities together.
- Setup Unit tests for you DAO interfaces.