Mapping domain objects with MongoDB

Let's begin by mapping our Event.java file so that each of the domain objects are saved as a document in our MongoDB database. This can be done by performing the following steps: 

  1. With a document database, domain object mapping is a little different, but the same ORM concepts hold true. Let's begin with the Event JPA implementation, then take a look how we can transform our Entity to document mapping:
        //src/main/java/com/packtpub/springsecurity/domain/Event.java         ...        import javax.persistence.*;        @Entity        @Table(name = "events")        public class Event implements Serializable{           @Id           @GeneratedValue(strategy = GenerationType.AUTO)           private Integer id;           private String summary;           private String description; private Calendar ...

Get Spring Security - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.