How do make a data class property transient? I hav...
# spring
t
How do make a data class property transient? I have a data class like this:
Copy code
@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!