Browse Source

session 5

master
Arthur Dambrine 3 years ago
parent
commit
e01ea70d40
  1. 6
      readme.md
  2. 42
      unit2_building_spring_boot_webapp.md

6
readme.md

@ -13,4 +13,8 @@ Session 1 - 26/10/2022 - stoped reading [@here](https://sparkers.udemy.com/cours
Session 2 - 27/10/2022 - finished unit 1 Session 2 - 27/10/2022 - finished unit 1
Session 3 - 28/10/2022 - ended [@here](https://sparkers.udemy.com/course/spring-framework-5-beginner-to-guru/learn/practice/1161612#overview) Session 3 - 28/10/2022 - spring initializr, open a spring project in IntelliJ and github workflow
Session 4 - 30/10/2022 - JPA entities
Session 5 - 31/10/2022 - Equality in hibernate and spring data repositories

42
unit2_building_spring_boot_webapp.md

@ -46,6 +46,9 @@ From the currated dependancies you can omit the version when you add them to you
Session 3 - 28/10/2022 - ended here Session 3 - 28/10/2022 - ended here
<hr> <hr>
## Github Workflow ## Github Workflow
[Starts from here](https://sparkers.udemy.com/course/spring-framework-5-beginner-to-guru/learn/lecture/17789252#overview) Github workflow. [Starts from here](https://sparkers.udemy.com/course/spring-framework-5-beginner-to-guru/learn/lecture/17789252#overview) Github workflow.
@ -137,5 +140,42 @@ Session 4 - 30/10/2022 : ended here
<hr> <hr>
### Equality in Hibernate
[Starts from here](https://sparkers.udemy.com/course/spring-framework-5-beginner-to-guru/learn/lecture/17792132#notes) Equality in hibernate
Leakage necessary - hibernates uses equals and hashcode methods.
#### Equals and HashCode
`@Override` the methods to have a logic around the id property.
**Tips**: use `alt+insert` equals() and hashCode() metods for the `id` field
#### ToString
**Tips**: `alt+insert` implement toString( )
### Spring Data Repositories
Spring Data with JPA helps us implement repositories.
Prevents us to write all this "ceremonial code" that JDBC needs.
Create a new package `repositories`
For each domain object create an `interface`.
Example: `AuthorRepository.java`
```java
public interface AuthorRepository extends CrudRepository<Author, Long> { }
```
***Session 5 - 31/10/2022 : [Starts from here](https://sparkers.udemy.com/course/spring-framework-5-beginner-to-guru/learn/lecture/17792132#notes) Equality in hibernate*** Session 5 - 31/10/2022 : ended here
Loading…
Cancel
Save