-
Notifications
You must be signed in to change notification settings - Fork 0
Week 38
Malte Hviid-Magnussen edited this page Sep 20, 2019
·
10 revisions
FOR REVIEWER - With regards to the questions in the exercise:
* I did these as Pair-Programming in the class on tuesday.
// EVERYWHERE IT SAID "EXPLAIN" WE EXPLAINED IT TO EACH OTHER VERBALLY.
// EVERYWHERE WE DIDN'T UNDERSTAND SOMETHING, WE ASKED THE TEACHER AND HE EXPLAINED TO US.
Continued Work on wednesday exercise and started looking at friday exercise. Work on the branch
- Explain the rationale behind the topic Object Relational Mapping and the Pros and Cons in using ORM
- The idea behind it is that you have to get Programming Objects into SQL data tables.
- Explain the JPA strategy for handling Object Relational Mapping and important classes/annotations involved.
- @Entity, @NativeQueries, @NativeQuery, @Id, @GeneratedValue, @ManyToOne, @OneToOne, etc.
- We use Entity classes and EntityManager istead of regular JDBC.
- We don't have to make our own datamappers anymore, which saves a huge amount of time.
- Outline some of the fundamental differences in Database handling using plain JDBC versus JPA
- JPA has the EntityManager to handle things automatically for you. That frees up a lot of time to do other coding.
- Discuss how we usually have queried a relational database
- We used to use JDBC and make SQL queries to the database directly.
- Discuss the methods we can use to query a JPA design and compare with what you explained above
- Now we use EntityManager and query via entity-classes in java. It is much easier, because you use the java object names, intead of the SQL table names. It converts the SQL data into objects for you automatically and vice-versa.