January 2019
Intermediate to advanced
392 pages
10h 11m
English
In this project, we will create a REST API to see the list of user details where we can get a username, email ID, and contact number. So let's create a model of a user where the class name is UserModel.kt.
Here is the code of the model class:
@Entity@Table(name="user_jpa")@EntityListeners(AuditingEntityListener::class)data class UserModel( @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") var id: Long = 0, @NotBlank @Column(name = "name") var name: String ?= null, @NotBlank @Column(name = "email") var email: String ?= null, @NotBlank @Column(name = "contact_number") var contact_number: String ?= null)
Here, our UserModel class has the following fields:
Read now
Unlock full access