<!-- Holon: JPA (Hibernate) starter -->
<dependency>
<groupId>com.holon-platform.jpa</groupId>
<artifactId>holon-starter-jpa-hibernate</artifactId>
</dependency>
application.yml
file:
spring:
datasource:
url: "jdbc:h2:mem:test"
username: "sa"
jpa:
hibernate:
ddl-auto: none
server:
port: 8080
This will auto-configure a Holon JPA Datastore, that will be available and accessible as a Spring Bean. The YAML file is quite similar to the JDBC version. Here we have in addition a feature to disable JPA database initialization.
UserEntity
:
@Entity(name = "users")
@Table(name = "users")
public class UserEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "email")
private String email;
@Column(name = "name")
private String name;
@Column(name = "password")
private String password;
@Column(name = "role")
private String role;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
...
In the first version of the demo we developed a custom menu to navigate through the application pages. Here we used Vaadin App Layout: it provides a quick and easy way to get a common application layout structure done. We set the logo, we configured the menu and we filled the pages content. Here is a screenshot of the result.