Skip to content

Instantly share code, notes, and snippets.

@sabljakovich
Last active September 11, 2021 14:26
Show Gist options
  • Save sabljakovich/137d23a0382f20625c32154e17ca72be to your computer and use it in GitHub Desktop.
Save sabljakovich/137d23a0382f20625c32154e17ca72be to your computer and use it in GitHub Desktop.
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