https://kotlinlang.org logo
#announcements
Title
# announcements
d

df

10/24/2020, 2:48 PM
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

janvladimirmostert

10/24/2020, 4:53 PM
try putting open in front of your properties,
Copy code
open var foo: String? = null
d

df

10/24/2020, 10:04 PM
Did you read my message? 🙂
j

janvladimirmostert

10/25/2020, 9:23 AM
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

df

10/25/2020, 10:27 AM
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!
5 Views