Master Finance Tools - 35% Off CFI (Code CFI35)
Master Windows Internals - Kernel Programming, Debugging & Architecture
Overview
Syllabus
Intro
Setup postgres DB Docker
Setup MySQL DB Docker
Create a new spring boot project
Setup the DB and create a schema Postgres
Setup the DB and create a schema MySQL
Connect the application to the database Postgres
Connect the application to the database MySQL
The project we will build
Hibernate VS Spring data jpa
Create the first java class
Transform the Java class to an Entity
@Id annotation
@GeneratedValue annotation
Strategy: Auto
@SequenceGenerator annotation
@TableGenerator annotation
@Column annotation overview
Usage of @Colum annotation
@Table annotation
Repository overview
Depp understanding of repositories
Discover the repositories as code
Create the first repository
Create a command line runner bean
Insert some data into the DB
Entity lifecycle
Why creating relationships between entities
The difference between unidirectional and bidirectional relationship
Create the course entity
Create the section entity
Create the lecture entity
Create the resource entity
@ManyToMany relationship
@ManyToOne relationship
One to many between section and lecture
@OneToOne relationship
Check if your code is correct
JPA Inheritance overview
Inheritance over composition
@MappedSuperClass
Create the child classes
Single table strategy
Single table discriminator value
Test single table strategy
Joined table strategy
Table per class strategy
Polymorphic queries
Embedded entities overview
Create embedded id class
Use the embedded ID
Test the embedded ID
Create an embeddable Address class
@Embaddable annotation
Derived queries explained
FindAllBy explained
Playing with findBy method
Add Java faker dependency
Insert fake data
Exercise
Exercise - Solution - Update a field
Update data with @Modifiying
@MamedQueries definition
Select data with named query
Update data with named queries
Specification overview
Extend the repository
Building the specification
Execute the specification