Commit 128b014c by Thaswin Muralikaran

Merge branch 'thaswin' into 'master'

Updated readme file

See merge request !5
parents 2f9fdb47 4ec171d2
...@@ -107,7 +107,7 @@ my-product-management-svc ...@@ -107,7 +107,7 @@ my-product-management-svc
- In the application.properties file under the resources folder add the database configuration. - In the application.properties file under the resources folder add the database configuration.
``` ```java properties
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/productmngm?createDatabaseIfNotExist=true&useSSL=false&serverTimezone=UTC spring.datasource.url=jdbc:mysql://127.0.0.1:3306/productmngm?createDatabaseIfNotExist=true&useSSL=false&serverTimezone=UTC
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=01234 spring.datasource.password=01234
...@@ -131,7 +131,7 @@ spring.jpa.hibernate.ddl-auto=update ...@@ -131,7 +131,7 @@ spring.jpa.hibernate.ddl-auto=update
##### i. Importing packages and classes ##### i. Importing packages and classes
``` ```java
package com.ctsb.my_product_management_svc.category; package com.ctsb.my_product_management_svc.category;
import com.ctsb.my_product_management_svc.product.Product; import com.ctsb.my_product_management_svc.product.Product;
...@@ -148,7 +148,7 @@ import java.util.List; ...@@ -148,7 +148,7 @@ import java.util.List;
##### ii. Adding annotations ##### ii. Adding annotations
``` ```java
@Getter @Getter
@Setter @Setter
@Entity @Entity
...@@ -157,7 +157,7 @@ import java.util.List; ...@@ -157,7 +157,7 @@ import java.util.List;
##### iii. Defining class and fields ##### iii. Defining class and fields
``` ```java
public class Category { public class Category {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
...@@ -183,7 +183,7 @@ public class Category { ...@@ -183,7 +183,7 @@ public class Category {
##### i. Importing packages and classes ##### i. Importing packages and classes
``` ```java
package com.ctsb.my_product_management_svc.product; package com.ctsb.my_product_management_svc.product;
import com.ctsb.my_product_management_svc.category.Category; import com.ctsb.my_product_management_svc.category.Category;
...@@ -197,7 +197,7 @@ import java.time.LocalDateTime; ...@@ -197,7 +197,7 @@ import java.time.LocalDateTime;
##### ii. Adding annotations ##### ii. Adding annotations
``` ```java
@Getter @Getter
@Setter @Setter
@Entity @Entity
...@@ -206,7 +206,7 @@ import java.time.LocalDateTime; ...@@ -206,7 +206,7 @@ import java.time.LocalDateTime;
##### iii. Defining class and fields ##### iii. Defining class and fields
``` ```java
public class Product { public class Product {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
...@@ -243,7 +243,7 @@ public enum Status { ...@@ -243,7 +243,7 @@ public enum Status {
##### v. Declaring relationship between category and product ##### v. Declaring relationship between category and product
``` ```java
//Declare one-to-many relationship to product in category //Declare one-to-many relationship to product in category
@OneToMany(mappedBy = "category", orphanRemoval = true) @OneToMany(mappedBy = "category", orphanRemoval = true)
@JsonIgnore @JsonIgnore
...@@ -259,6 +259,7 @@ public enum Status { ...@@ -259,6 +259,7 @@ public enum Status {
<summary>Full code of category entity</summary> <summary>Full code of category entity</summary>
```java ```java
package com.ctsb.my_product_management_svc.category; package com.ctsb.my_product_management_svc.category;
import com.ctsb.my_product_management_svc.product.Product; import com.ctsb.my_product_management_svc.product.Product;
...@@ -307,6 +308,7 @@ private Long id; ...@@ -307,6 +308,7 @@ private Long id;
<summary>Full code of product entity</summary> <summary>Full code of product entity</summary>
```java ```java
package com.ctsb.my_product_management_svc.product; package com.ctsb.my_product_management_svc.product;
import com.ctsb.my_product_management_svc.category.Category; import com.ctsb.my_product_management_svc.category.Category;
...@@ -345,6 +347,7 @@ public class Product { ...@@ -345,6 +347,7 @@ public class Product {
@JoinColumn(name = "category_id", nullable = false) @JoinColumn(name = "category_id", nullable = false)
private Category category; private Category category;
} }
``` ```
</details> </details>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment