The domain model

The following sections show how to implement CRUD views using two different designs: a Grid in editable mode, and modal windows. But first, we need to implement a domain model. We'll use JPA and repository classes, which we explained in the previous chapters. The domain model consists of simple classes to model a role-based schema: Userand Role. It also includes the corresponding UserRepository and RoleRepository classes.

Let's start with the simplest of the classes, Role. The following is the full implementation of this class:

@Entity@Datapublic class Role {    @Id    @GeneratedValue    private Long id;    private String name;    private Boolean module1Authorized;    private Boolean module2Authorized;    @Override    public String toString() ...

Get Data-Centric Applications with Vaadin 8 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.