We will create the Stock document class, as shown in the following code. It contains three member variables—code, name, and description:
@Document
public class Stock {
private String code;
private String name;
private String description;
//Getters, Setters and Constructor
}