Web-Ecommerce
Springboot Web Application
The main goal of the project is to reproduce a Database for a Ecommerce Web Application;
We have a Category-Product relation, so that One category can have Many Products (1:N);
Some concepts are studied, like Persistence in memory (JPA), H2 database, Dependency injection, Serializable, Domain Drive Design, Object Oriented Programming, HTTP knowledge...
The relationship is first set when the dependencies are imported as seen below.
Secondly, to manipulate Jpa and H2, use the notations
// As it is shown, Id notation says that the atribute is of type Id and @GeneratedValue(strategy = GenerationType.IDENTITY) autoincrements it
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Once it is stablished in one side, it has to be on the other, like this.
Note that one notation is @OneToMany and the other is @ManyToOne, defining who is 1 and who is N at a 1:N relation