Last active
September 11, 2021 14:26
-
-
Save sabljakovich/137d23a0382f20625c32154e17ca72be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sabljakovic.mongospringdemo; | |
import org.springframework.data.annotation.Id; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
@Document | |
public class Product { | |
@Id | |
private String productId; | |
private String name; | |
public Product(String name) { | |
this.name = name; | |
} | |
public Product(){ | |
} | |
public String getProductId() { | |
return productId; | |
} | |
public void setProductId(String productId) { | |
this.productId = productId; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
@Override | |
public String toString() { | |
return "Product{" + | |
"productId='" + productId + '\'' + | |
", name='" + name + '\'' + | |
'}'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment