Question about kotlin and hibernate/JPA. I am using maven and "kotlin-maven-noarg" dependency to have default constructor. For my entity class, which is a data class, I found two ways to make it work. One is having var's and other is val with default null as in the snippets. As I understood it hibernate creates the class through reflection and then populates it. Now if I use val - I thought it would be immuteable with the default value of null (as in code snippet), yet it gives me correct result with real names when I try to create customers with hibernate. Anyone know why, and also which of the two solutions is the better one to use?