Creating a Person entity

Let's create a new Person entity class to store to MongoDB. The following snippet shows a Person class with an ID and a name:

public class Person {

@Id
private String id;

private String name;

public Person() {
}

public Person(String name) {
super();
this.name = name;
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset