Creating models

We previously identified two distinct types of entities that must be catered for in our system: the User entity and the Review entity. It is time to create appropriate models for these entities. The first of these entities we will concern ourselves with is the User. Create a data package within the com.example.placereviewer package. Add a model package within the newly created data package. Now, add a User.kt file within the newly created com.example.placereviewer.data.model package with the following content:

package com.example.placereviewer.data.modelimport com.example.placereviewer.listener.UserListenerimport org.springframework.format.annotation.DateTimeFormatimport java.time.Instantimport java.util.*import javax.persistence.* ...

Get Kotlin Programming By Example 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.