1. Setting Up the Booking Application

In this section, you create a minimal room booking application with an enumeration, an entity, and CRUD views. This application is used later in Template Definition.

If you are new to Jmix, see the Tutorial, which explains common operations in greater detail.

Creating Room Enumeration

Assume that the office has three rooms of different sizes. Create a Room enumeration with the following values:

  • Small

  • Medium

  • Large

Creating Booking Entity

Create the Booking entity.

The Booking entity has the following attributes:

  • title - booking title. Mandatory.

  • room with Room enum type - selected room. Mandatory.

  • startDate with LocalDateTime type - booking start time. Mandatory.

  • endDate with LocalDateTime type - booking end time. Mandatory.

  • creator - association with the User entity. Mandatory.

Creating CRUD Views

Create list and detail views for the Booking entity:

  1. Open the view creation wizard for the Booking entity.

  2. Select the List and detail views template.

  3. At the Entity list view fetch plan step, select the creator attribute.

  4. Accept the default settings for all other steps.

Running the Application

Run the application from Studio.

When the application starts, open http://localhost:8080 in a web browser, log in with admin / admin, and select Bookings from the main application menu.