Hey there. I'm building an app with kotlin and jpa...
# announcements
d
Hey there. I'm building an app with kotlin and jpa. When starting the application I get the following error / warning
org.hibernate.HibernateException: Getter methods of lazy classes cannot be final: SomeEntity#getFoo
. The error is gone when I mark the property explicitly as open but from what I understood is that this should happen automatically with the jpa compiler plugin?
j
try putting open in front of your properties,
Copy code
open var foo: String? = null
d
Did you read my message? 🙂
j
That last part was not visible when i initially read it, weird So you've already done that ... the JPA plugin as far as i know is built on top of the no-arg plugin which means it only deals with constructors and i'm assuming generating no-arg constructors There is an all-open plugin where you should be able to specify which annotations should trigger an automatic
open
prefix
d
Oh.. i totally missed that. I was using the spring and jpa plugin and somehow assumed one of them would take care of making entities open. Thanks!