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