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
- 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.username=root
spring.datasource.password=01234
......@@ -131,7 +131,7 @@ spring.jpa.hibernate.ddl-auto=update
##### i. Importing packages and classes
```
```java
package com.ctsb.my_product_management_svc.category;
import com.ctsb.my_product_management_svc.product.Product;
......@@ -148,7 +148,7 @@ import java.util.List;
##### ii. Adding annotations
```
```java
@Getter
@Setter
@Entity
......@@ -157,7 +157,7 @@ import java.util.List;
##### iii. Defining class and fields
```
```java
public class Category {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -183,7 +183,7 @@ public class Category {
##### i. Importing packages and classes
```
```java
package com.ctsb.my_product_management_svc.product;
import com.ctsb.my_product_management_svc.category.Category;
......@@ -197,7 +197,7 @@ import java.time.LocalDateTime;
##### ii. Adding annotations
```
```java
@Getter
@Setter
@Entity
......@@ -206,7 +206,7 @@ import java.time.LocalDateTime;
##### iii. Defining class and fields
```
```java
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -243,7 +243,7 @@ public enum Status {
##### v. Declaring relationship between category and product
```
```java
//Declare one-to-many relationship to product in category
@OneToMany(mappedBy = "category", orphanRemoval = true)
@JsonIgnore
......@@ -259,6 +259,7 @@ public enum Status {
<summary>Full code of category entity</summary>
```java
package com.ctsb.my_product_management_svc.category;
import com.ctsb.my_product_management_svc.product.Product;
......@@ -307,6 +308,7 @@ private Long id;
<summary>Full code of product entity</summary>
```java
package com.ctsb.my_product_management_svc.product;
import com.ctsb.my_product_management_svc.category.Category;
......@@ -345,6 +347,7 @@ public class Product {
@JoinColumn(name = "category_id", nullable = false)
private Category category;
}
```
</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