Book Image

Data-Centric Applications with Vaadin 8

By : Alejandro Duarte
Book Image

Data-Centric Applications with Vaadin 8

By: Alejandro Duarte

Overview of this book

Vaadin is an open-source Java framework used to build modern user interfaces. Vaadin 8 simplifies application development and improves user experience. The book begins with an overview of the architecture of Vaadin applications and the way you can organize your code in modules.Then it moves to the more advanced topics about advanced topics such as internationalization, authentication, authorization, and database connectivity. The book also teaches you how to implement CRUD views, how to generate printable reports, and how to manage data with lazy loading. By the end of this book you will be able to architect, implement, and deploy stunning Vaadin applications, and have the knowledge to master web development with Vaadin.
Table of Contents (11 chapters)

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: User, and 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
@Data
public class Role {

@Id
@GeneratedValue
private Long id;

private String name;

private Boolean module1Authorized;

private Boolean module2Authorized;

@Override
public String toString() {
return name;
}
}

Besides the usual JPA configuration stuff (such as the @Entity, @Id, and @GeneratedValue...