TheOnlyTails
01/16/2021, 11:01 AM@Entity
@Table
data class Student(
@Id
@SequenceGenerator(name = "student_sequence", sequenceName = "student_sequence", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "student_sequence")
var id: Long? = null,
val name: String,
val email: String,
val dateOfBirth: LocalDate,
val age: Int,
)
Since I have dateOfBirth
, I can just calculate the age from it, so I want to make it transient. Thing is, I am very new to Spring Boot and SQL, and have no idea how to do this. Googling did not help.
Thanks in advance!