Creating a Comment entity

Create a Comment entity named Comment.kt with the @Entity annotation to convert this class into an entity class. Here is the code of this model class:

@Entity
class Comment(text: String, postedBy: Profile) : Serializable {

@Id
@GeneratedValue
var id: Long? = 0

var text: String? = text

@JsonIgnore
@JsonProperty("accCreatedTime")
var accCreatedTime: Instant? = Instant.now()

@ManyToOne
@JoinColumn(name = "profile_id")
@JsonIgnoreProperties("username","password","email","accCreatedTime","firstName","lastName" , "contactNumber","dob","city","country")
var postedBy: Profile? = postedBy
}

Here we have three elements and one constructor. Here is the constructor:

@Entity
class Comment(text: String, postedBy: Profile) : Serializable {
-----
-----
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.83.199