January 2019
Intermediate to advanced
392 pages
10h 11m
English
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:
@Entityclass 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:
@Entityclass Comment(text: String, postedBy: Profile) : Serializable ...Read now
Unlock full access