O'Reilly logo

Spring Security - Third Edition by Peter Mularien, Robert Winch, Mick Knutson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required